/* =====================================================================
   Legault Research Group — site styles
   ===================================================================== */

:root {
  --bg: #f8faf8;
  --surface: #ffffff;
  --surface-2: #eff4f0;
  --ink: #0f1f18;
  --ink-2: #394a42;
  --muted: #66766e;
  --line: #dfe7e1;
  --brand: #00a759;          /* Université de Sherbrooke green */
  --brand-strong: #007a41;   /* accessible on light surfaces */
  --brand-soft: #e2f4e9;
  --iodine: #6b3fa3;         /* iodine-vapour violet accent */
  --iodine-soft: #efe7f8;
  --figure-bg: #ffffff;
  --shadow: 0 1px 2px rgb(15 31 24 / .04), 0 6px 16px -12px rgb(15 31 24 / .12);
  --radius: 10px;
  --radius-sm: 6px;
  --max: 1160px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1210;
    --surface: #111a17;
    --surface-2: #17221e;
    --ink: #e7efe9;
    --ink-2: #b8c6be;
    --muted: #8b9b92;
    --line: #22302b;
    --brand: #2ccf7c;
    --brand-strong: #4bdc92;
    --brand-soft: #10301f;
    --iodine: #b995ec;
    --iodine-soft: #231a33;
    --figure-bg: #f4f6f4;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -14px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1210; --surface: #111a17; --surface-2: #17221e; --ink: #e7efe9; --ink-2: #b8c6be;
  --muted: #8b9b92; --line: #22302b; --brand: #2ccf7c; --brand-strong: #4bdc92; --brand-soft: #10301f;
  --iodine: #b995ec; --iodine-soft: #231a33; --figure-bg: #f4f6f4;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px -14px rgb(0 0 0 / .6);
  color-scheme: dark;
}

/* ---------- Language switching ---------- */
html[data-lang="fr"] [data-l="en"],
html[data-lang="en"] [data-l="fr"] { display: none !important; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 600; line-height: 1.25; letter-spacing: -0.012em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.18; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 1.8vw, 1.4rem); }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
sub, sup { line-height: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 16px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.eyebrow { font-family: var(--font-sans); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-strong); margin: 0 0 .9rem; }
.lead { font-size: clamp(1rem, 1.2vw, 1.08rem); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 16px; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand-logo { height: 34px; width: auto; flex: none; }
.brand-text { font-size: .75rem; line-height: 1.3; color: var(--muted); max-width: 13.5rem; padding-left: 14px; border-left: 1px solid var(--line); }

.nav { display: none; }
.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a { display: block; white-space: nowrap; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--brand-strong); background: var(--brand-soft); }

.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); flex: none; }
.lang-switch button { all: unset; cursor: pointer; font-size: .75rem; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; color: var(--muted); }
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.lang-switch button:focus-visible { outline: 2px solid var(--brand); }

.menu-toggle { all: unset; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--ink); flex: none; }
.menu-toggle:hover { background: var(--surface-2); }
.menu-toggle svg { width: 22px; height: 22px; }

.mobile-nav { display: none; border-top: 1px solid var(--line); padding: 8px 0 16px; }
.mobile-nav.open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav a { display: block; padding: 12px 4px; color: var(--ink); text-decoration: none; font-weight: 500; border-bottom: 1px solid var(--line); }
.mobile-nav a[aria-current="page"] { color: var(--brand-strong); }

@media (min-width: 1024px) {
  .nav { display: block; }
  .menu-toggle, .mobile-nav, .mobile-nav.open { display: none; }
}
@media (max-width: 480px) { .brand-text { display: none; } }
@media (min-width: 1024px) { .brand-text { display: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(36px, 5vw, 60px) 0; }
.section + .section:not(.band) { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 24px; margin-bottom: 20px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); max-width: 52ch; }
.band { background: var(--surface-2); border-block: 1px solid var(--line); }
.band + .section:not(.band) { padding-top: clamp(36px, 5vw, 60px); }

.page-hero { padding: clamp(30px, 4.5vw, 52px) 0 clamp(22px, 3.2vw, 36px); border-bottom: 1px solid var(--line); background:
  radial-gradient(900px 300px at 85% -10%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%), var(--bg); }
.page-hero h1 { margin-bottom: .35em; }
.page-hero .lead { margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 8px; font-weight: 600; font-size: .92rem; text-decoration: none; border: 1px solid transparent; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #04140b; } }
:root[data-theme="dark"] .btn-primary { color: #04140b; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); }
.btn svg { width: 16px; height: 16px; }

/* ---------- Home hero ---------- */
.hero { position: relative; padding: clamp(36px, 6vw, 76px) 0 clamp(30px, 5vw, 60px); overflow: hidden;
  background:
    radial-gradient(700px 380px at 90% 10%, color-mix(in srgb, var(--iodine) 12%, transparent), transparent 70%),
    radial-gradient(800px 420px at 70% 90%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 70%),
    var(--bg);
}
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; } }
.hero h1 em { font-style: normal; color: var(--brand-strong); }
.hero h1 .iod { color: var(--iodine); }
.hero .lead { margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { max-width: 460px; width: 100%; margin: 0 auto; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: clamp(40px, 6vw, 64px); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: var(--surface); padding: 20px 22px; }
.stat b { display: block; font-family: var(--font-sans); font-size: 1.5rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--muted); }

/* ---------- Cards ---------- */
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
a.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.card .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--brand-strong); font-weight: 600; font-size: .92rem; }

.icon-tile { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 14px; background: var(--brand-soft); color: var(--brand-strong); }
.icon-tile.iodine { background: var(--iodine-soft); color: var(--iodine); }
.icon-tile svg { width: 21px; height: 21px; }
.element { font-family: var(--font-sans); font-weight: 600; font-size: 1.2rem; position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.element small { position: absolute; top: 4px; left: 6px; font-family: var(--font-sans); font-size: .58rem; font-weight: 600; }

/* ---------- Featured carousel ---------- */
.carousel { position: relative; }
.carousel-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 86%); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 18px; scrollbar-width: thin; overscroll-behavior-x: contain; }
@media (min-width: 720px) { .carousel-track { grid-auto-columns: calc((100% - 20px) / 2); } }
@media (min-width: 1080px) { .carousel-track { grid-auto-columns: calc((100% - 40px) / 3); } }
.feature { scroll-snap-align: start; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; transition: border-color .2s ease; }
.feature:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.feature figure { margin: 0; background: #fff; aspect-ratio: 2 / 1; overflow: hidden; border-bottom: 1px solid var(--line); }
.feature figure img { width: 100%; height: 100%; object-fit: contain; }
.feature .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.feature h3 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; line-height: 1.4; margin: 0; letter-spacing: 0; }
.feature .cite { font-size: .85rem; color: var(--muted); margin-top: auto; }
.carousel-controls { display: flex; gap: 8px; }
.icon-btn { all: unset; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.icon-btn:hover { border-color: var(--muted); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- Software ---------- */
.software { display: grid; gap: 20px; align-items: start; }
.software .logo-box { background: var(--figure-bg); border-radius: 10px; padding: 14px 18px; display: inline-flex; margin-bottom: 18px; min-height: 76px; align-items: center; }
.software .logo-box img { max-height: 52px; width: auto; }

/* ---------- Publications ---------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { display: grid; grid-template-columns: 3.2rem 1fr; gap: 2px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-num { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.pub-title { font-weight: 600; font-size: 1rem; line-height: 1.45; margin: 0 0 4px; color: var(--ink); }
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { color: var(--brand-strong); text-decoration: underline; }
.pub-authors { font-size: .92rem; color: var(--ink-2); margin: 0 0 4px; }
.pub-authors b { color: var(--ink); font-weight: 600; }
.pub-cite { font-size: .92rem; color: var(--muted); margin: 0; }
.pub-cite a { color: var(--muted); }
.pub-cite a:hover { color: var(--brand-strong); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: .75rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--iodine-soft); color: var(--iodine); line-height: 1.4; }
.badge.green { background: var(--brand-soft); color: var(--brand-strong); }
mark { background: color-mix(in srgb, var(--brand) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.pub-layout { display: grid; gap: 32px; }
@media (min-width: 960px) { .pub-layout { grid-template-columns: 220px 1fr; gap: 56px; } }
.pub-aside { align-self: start; }
@media (min-width: 960px) { .pub-aside { position: sticky; top: 92px; } }
.year-nav { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 960px) { .year-nav { display: grid; grid-template-columns: repeat(3, 1fr); } }
.year-nav a { font-size: .85rem; font-weight: 600; text-align: center; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; background: var(--surface); font-variant-numeric: tabular-nums; }
.year-nav a:hover { border-color: var(--brand); color: var(--brand-strong); }
.year-nav a.wide { grid-column: 1 / -1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.search { position: relative; flex: 1 1 280px; }
.search input { width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px 12px 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.search input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.chip { all: unset; cursor: pointer; font-size: .85rem; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:focus-visible { outline: 2px solid var(--brand); }
.result-count { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.year-group { margin-top: 30px; }
.year-group h2 { display: flex; align-items: baseline; gap: 12px; font-size: 1.2rem; padding-bottom: 8px; border-bottom: 1px solid var(--ink); margin-bottom: 0; }
.year-group h2 small { font-family: var(--font-sans); font-size: .85rem; font-weight: 500; color: var(--muted); }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---------- Prose / research ---------- */
.prose { max-width: 72ch; }
.prose p { color: var(--ink-2); }
.prose h2 { margin-top: 0; }
.prose h3 { margin-top: 1.5em; }
.research-layout { display: grid; gap: 40px; }
@media (min-width: 960px) { .research-layout { grid-template-columns: 220px 1fr; gap: 64px; } }
.toc { align-self: start; font-size: .92rem; }
@media (min-width: 960px) { .toc { position: sticky; top: 92px; } }
.toc p { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--brand-strong); border-left-color: var(--brand); }
.research-section { padding-bottom: 38px; margin-bottom: 38px; border-bottom: 1px solid var(--line); }
.research-section:last-child { border-bottom: 0; margin-bottom: 0; }
.axis { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; }
.axis h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin: 0 0 .5em; display: flex; gap: 10px; align-items: baseline; }
.axis h3 .n { flex: none; font-family: var(--font-sans); color: var(--iodine); font-size: 1rem; }
.axis p { margin: 0; }
.axis p + p { margin-top: .8em; }
.figure { margin: 24px 0; background: var(--figure-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.figure img { margin: 0 auto; max-height: 300px; width: auto; }
.figure figcaption { font-size: .85rem; color: #55645c; text-align: center; margin-top: 12px; }
.figure figcaption a { color: #55645c; }
.collab { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.collab li { background: var(--surface); padding: 10px 16px; display: grid; gap: 2px 20px; }
@media (min-width: 720px) { .collab li { grid-template-columns: 1fr 260px; align-items: baseline; } }
.collab a { color: var(--ink); text-decoration: none; font-weight: 500; }
.collab a:hover { color: var(--brand-strong); text-decoration: underline; }
.collab span { font-size: .85rem; color: var(--muted); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.pill-row li { font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

/* ---------- Team ---------- */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--muted); }
.notice.open { border-left-color: var(--brand); background: var(--brand-soft); }
.notice svg { flex: none; width: 22px; height: 22px; color: var(--muted); margin-top: 2px; }
.notice.open svg { color: var(--brand-strong); }
.notice p { margin: 0; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; }
.people { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: .92rem; background: var(--brand-soft); color: var(--brand-strong); overflow: hidden; }
.avatar.phd { background: var(--iodine-soft); color: var(--iodine); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin: 0; line-height: 1.3; }
.person p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.person .deg { font-weight: 600; color: var(--ink-2); }
.team-group { margin-top: 34px; }
.team-group > h2 { font-size: 1.2rem; display: flex; align-items: baseline; gap: 10px; }
.team-group > h2 small { font-family: var(--font-sans); font-size: .85rem; font-weight: 500; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); }
table.data td.when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Timeline (PI page) ---------- */
.profile { display: grid; gap: 32px; align-items: start; }
@media (min-width: 860px) { .profile { grid-template-columns: 300px 1fr; gap: 56px; } }
.profile-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
@media (min-width: 860px) { .profile-card { position: sticky; top: 92px; } }
.profile-card img { width: 100%; aspect-ratio: 450 / 520; object-fit: cover; object-position: center 20%; background: var(--surface-2); }
.profile-card .body { padding: 20px 22px 22px; }
.profile-card h2 { font-size: 1.15rem; margin-bottom: 2px; }
.profile-card p { margin: 0 0 12px; color: var(--muted); font-size: .92rem; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.link-list a { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; min-width: 0; padding: 8px 0; color: var(--ink-2); text-decoration: none; font-size: .92rem; border-top: 1px solid var(--line); }
.link-list a:hover { color: var(--brand-strong); }
.link-list svg { width: 16px; height: 16px; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 1fr; gap: 0 24px; padding: 12px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) { .timeline li { grid-template-columns: 120px 1fr; } }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: .85rem; font-weight: 600; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.timeline .what { color: var(--ink); }
.timeline .where { display: block; color: var(--muted); font-size: .92rem; }
.cv-block { margin-top: 34px; }
.cv-block h2 { font-size: 1.2rem; padding-bottom: 8px; border-bottom: 1px solid var(--ink); margin-bottom: 4px; }
details.more-list summary { cursor: pointer; font-weight: 600; color: var(--brand-strong); padding: 12px 0; list-style: none; }
details.more-list summary::-webkit-details-marker { display: none; }
details.more-list summary::before { content: "+ "; }
details.more-list[open] summary::before { content: "− "; }

/* ---------- Courses ---------- */
.course { display: grid; gap: 16px; }
@media (min-width: 720px) { .course { grid-template-columns: 110px 1fr auto; align-items: center; } }
.course-code { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--brand-strong); }
.course h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin: 0; }
.course p { margin: 4px 0 0; font-size: .92rem; color: var(--muted); }

/* ---------- Contact / footer ---------- */

.site-footer { margin-top: 0; border-top: 1px solid var(--line); background: var(--surface); font-size: .92rem; }
.footer-grid { display: grid; gap: 28px; padding: 34px 0 24px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h4 { font-family: var(--font-sans); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.site-footer address { font-style: normal; color: var(--ink-2); line-height: 1.75; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--ink-2); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.site-footer ul a:hover { color: var(--brand-strong); }
.site-footer ul svg { width: 16px; height: 16px; flex: none; }
.site-footer ul small { display: block; color: var(--muted); font-size: .75rem; }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px 0 28px; color: var(--muted); font-size: .75rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.footer-bottom p { margin: 0; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; }
.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; }
.img-missing { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px); min-height: 120px; }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Overflow guards (long chemical names, narrow screens) ---------- */
.pub-layout, .research-layout, .profile { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .pub-layout, .research-layout { grid-template-columns: 220px minmax(0, 1fr); } }
@media (min-width: 860px) { .profile { grid-template-columns: 300px minmax(0, 1fr); } }
.pub-layout > *, .research-layout > *, .profile > * { min-width: 0; }
.pub-title, .pub-authors, .pub-cite, .feature h3, .axis, .collab a { overflow-wrap: break-word; hyphens: manual; }

/* ---------- Warnings (publications.txt) ---------- */
:root { --warn: #9a5b00; --warn-soft: #fff4de; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --warn: #f2b65a; --warn-soft: #2b2112; } }
:root[data-theme="dark"] { --warn: #f2b65a; --warn-soft: #2b2112; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); border-left-color: var(--warn); margin: 16px 0 8px; }
.notice.warn svg { color: var(--warn); }
.notice.warn ul { margin: 6px 0 0; padding-left: 18px; font-size: .92rem; }
.notice.warn p + ul { margin-top: 4px; }
.notice code { font-size: .88em; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 5px; border-radius: 4px; }

/* Slide graphics reused as figures: hide the slide's own label and citation band */
.figure img.slide-crop { max-height: none; width: 100%; aspect-ratio: 1280 / 440; object-fit: cover; object-position: 50% 37%; }

/* ---------- Key work cards (summary) ---------- */
.feature .year-tag { align-self: flex-start; font-size: .75rem; font-weight: 600; letter-spacing: .06em; color: var(--iodine); background: var(--iodine-soft); padding: 2px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.feature .summary { font-size: .92rem; color: var(--ink-2); margin: 0; line-height: 1.55; }
.feature h3 + .summary { margin-top: 2px; }
.milestone-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .milestone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.theme-figure { margin: 24px 0 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.theme-figure img { width: 100%; height: auto; }
.theme-figure figcaption { font-size: .85rem; color: #55645c; padding: 10px 16px 12px; border-top: 1px solid var(--line); background: #fff; }
.theme-figure figcaption a { color: #55645c; }
.ref-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ref-list li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.ref-list a { color: var(--ink); font-weight: 500; text-decoration: none; }
.ref-list a:hover { color: var(--brand-strong); text-decoration: underline; }
.ref-list span { display: block; font-size: .85rem; color: var(--muted); }
details.legacy { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
details.legacy > summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--brand-strong); list-style: none; }
details.legacy > summary::-webkit-details-marker { display: none; }
details.legacy > summary::before { content: "+ "; }
details.legacy[open] > summary::before { content: "− "; }
details.legacy > .legacy-body { padding: 0 20px 8px; }
details.legacy .research-section { border-bottom: 0; margin-bottom: 0; padding-bottom: 24px; }

/* ---------- Software page ---------- */
.sw-head { display: grid; gap: 28px; align-items: start; }
@media (min-width: 900px) { .sw-head { grid-template-columns: 1.2fr .8fr; gap: 56px; } .sw-logo { margin-top: 52px; } }
.sw-logo { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; place-items: center; min-height: 160px; }
.sw-logo img { max-height: 90px; width: auto; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--iodine); background: var(--iodine-soft); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.facts li { font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.facts b { color: var(--ink); font-weight: 600; }
.feature-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); margin-top: 24px; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feature-grid .card { padding: 18px; }
.feature-grid h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin-bottom: 6px; }
.feature-grid p { font-size: .92rem; color: var(--ink-2); margin: 0; }
.cite-box { margin: 28px 0 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; padding: 16px 18px; }
.cite-box p { margin: 0; }
.cite-box .label { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cite-box q { quotes: none; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85rem; color: var(--ink); }
.cite-box + .cite-box { margin-top: 10px; }
.copy-btn { all: unset; cursor: pointer; font-size: .75rem; font-weight: 600; color: var(--brand-strong); margin-left: 10px; }
.copy-btn:focus-visible { outline: 2px solid var(--brand); border-radius: 4px; }
.method-groups { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-top: 20px; }
@media (min-width: 720px) { .method-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.method-groups .card { padding: 20px 22px; }
.method-groups h3 { font-family: var(--font-sans); font-size: .92rem; font-weight: 600; letter-spacing: 0; margin: 0 0 10px; }
.method-groups ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.method-groups li { font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); font-weight: 500; }

/* ---------- Hero with background picture (trial) ---------- */
.hero-pic { display: flex; flex-direction: column; }
.hero-pic .container { position: relative; z-index: 1; }
.hero-bg { display: block; width: 100%; max-width: 560px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 88% center; margin: 0 auto -8px; order: 2; }
@media (min-width: 900px) {
  .hero-pic { display: block; }
  .hero-bg { position: absolute; top: 52%; right: max(0px, calc((100vw - 1320px) / 2)); transform: translate(8.5%, -50%); height: 112%; width: auto; max-width: none; aspect-ratio: auto; object-fit: contain; margin: 0; pointer-events: none;
    -webkit-mask-image: linear-gradient(90deg, transparent 4%, rgba(0,0,0,.5) 30%, #000 48%); mask-image: linear-gradient(90deg, transparent 4%, rgba(0,0,0,.5) 30%, #000 48%); }
  .hero-pic .hero-grid { grid-template-columns: minmax(0, min(560px, 50%)); }
  .hero-pic { min-height: 440px; display: grid; align-items: center; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-bg { filter: invert(1) hue-rotate(180deg); } }
:root[data-theme="dark"] .hero-bg { filter: invert(1) hue-rotate(180deg); }
