/* ==========================================================================
   François HU, editorial academic theme
   1. Tokens
   2. Reset & base
   3. Typography / prose
   4. Layout primitives
   5. Header & footer
   6. Components (buttons, cards, tags, publications, timeline…)
   7. Page-specific blocks
   8. Motion & responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  /* Light palette: warm paper */
  --paper:        #fbfaf7;
  --paper-tint:   #f4f2ec;
  --surface:      #ffffff;
  --surface-alt:  #f7f5f0;
  --ink:          #14161a;
  --ink-soft:     #4e5563;
  --ink-faint:    #7c8494;
  --rule:         #e4e0d6;
  --rule-strong:  #d3cec0;

  --accent:       #0d6b60;
  --accent-hover: #0a544b;
  --accent-tint:  #e4f0ee;
  --accent-ink:   #ffffff;
  --warm:         #b0522c;
  --warm-tint:    #f7ebe4;

  --shadow-sm: 0 1px 2px rgba(20, 22, 26, .05), 0 2px 8px rgba(20, 22, 26, .04);
  --shadow-md: 0 2px 4px rgba(20, 22, 26, .05), 0 12px 32px rgba(20, 22, 26, .08);

  /* Type */
  --font-serif: "Source Serif 4", Iowan Old Style, Palatino, Georgia, serif;
  --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
  --step-0:  clamp(1rem, .97rem + .15vw, 1.075rem);
  --step-1:  clamp(1.16rem, 1.1rem + .3vw, 1.33rem);
  --step-2:  clamp(1.38rem, 1.26rem + .58vw, 1.78rem);
  --step-3:  clamp(1.66rem, 1.42rem + 1.1vw, 2.44rem);
  --step-4:  clamp(2rem, 1.5rem + 2.2vw, 3.4rem);

  /* Space */
  --gap:        1.25rem;
  --gap-lg:     2rem;
  --section-y:  clamp(3.5rem, 2rem + 6vw, 6.5rem);
  --wrap:       72rem;
  --wrap-text:  46rem;
  --radius:     14px;
  --radius-sm:  9px;
  --header-h:   4.25rem;
}

:root { color-scheme: light; }

/* Dark palette: applied via media query and explicit toggle */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #0f1113;
    --paper-tint:   #15181c;
    --surface:      #171a1f;
    --surface-alt:  #1d2127;
    --ink:          #f1efea;
    --ink-soft:     #aab2bf;
    --ink-faint:    #7f8896;
    --rule:         #292e36;
    --rule-strong:  #3a414b;

    --accent:       #5fd0bf;
    --accent-hover: #86e0d2;
    --accent-tint:  #12312e;
    --accent-ink:   #06231f;
    --warm:         #e79367;
    --warm-tint:    #33211a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .45);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:        #0f1113;
  --paper-tint:   #15181c;
  --surface:      #171a1f;
  --surface-alt:  #1d2127;
  --ink:          #f1efea;
  --ink-soft:     #aab2bf;
  --ink-faint:    #7f8896;
  --rule:         #292e36;
  --rule-strong:  #3a414b;

  --accent:       #5fd0bf;
  --accent-hover: #86e0d2;
  --accent-tint:  #12312e;
  --accent-ink:   #06231f;
  --warm:         #e79367;
  --warm-tint:    #33211a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .45);

  color-scheme: dark;
}

/* 2. Reset & base ---------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: .7rem 1.1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: var(--accent-ink); }

.icon { width: 1em; height: 1em; flex: none; }
.muted { color: var(--ink-soft); }
.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;
}

/* 3. Typography ------------------------------------------------------------ */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.eyebrow {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: .5em;
  align-items: center;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }

.prose { font-size: var(--step-0); }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: var(--step-2);
  margin-top: 2.4em;
  padding-top: .6em;
  border-top: 1px solid var(--rule);
}
.prose h3 { font-size: var(--step-1); margin-top: 2em; }
.prose h4 { font-size: var(--step-0); margin-top: 1.7em; font-family: var(--font-sans); font-weight: 700; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--ink-faint); }
.prose li + li { margin-top: .4em; }
.prose strong { font-weight: 650; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: .2em 0 .2em 1.2em;
  font-family: var(--font-serif);
  font-size: var(--step-1);
  font-style: italic;
  color: var(--ink-soft);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-alt);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: .12em .38em;
}
.prose pre {
  background: var(--surface-alt);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--rule); }
.prose figure figcaption,
.prose img + em {
  display: block;
  font-size: var(--step--1);
  color: var(--ink-faint);
  margin-top: .6em;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  display: block;
  overflow-x: auto;
}
.prose th, .prose td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 650; background: var(--surface-alt); }

/* 4. Layout ---------------------------------------------------------------- */

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}
.wrap--text { width: min(100% - 2.5rem, var(--wrap-text)); }

.site-main { display: block; }

.section { padding-block: var(--section-y); }
.section--tint {
  background: var(--paper-tint);
  border-block: 1px solid var(--rule);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.section__title { font-size: var(--step-3); margin-top: .3rem; }
.section__more {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.section__more:hover { border-bottom-color: currentColor; }
.section__more .icon { transition: transform .2s ease; }
.section__more:hover .icon { transform: translateX(3px); }

.grid { display: grid; gap: var(--gap-lg); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }

/* 5. Header & footer ------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-stuck {
  border-bottom-color: var(--rule);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--gap);
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand__mark {
  width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--font-serif); font-weight: 600; font-size: 1.02rem; }
.brand__role { font-size: .72rem; color: var(--ink-faint); letter-spacing: .02em; }

.nav__list { display: flex; align-items: center; gap: .25rem; }
.nav__link {
  display: block;
  padding: .45rem .7rem;
  border-radius: 7px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.nav__link:hover { background: var(--surface-alt); color: var(--ink); }
.nav__link.is-current { color: var(--ink); font-weight: 600; background: var(--accent-tint); }

.site-header__tools { display: flex; align-items: center; gap: .4rem; }

.icon-btn {
  width: 2.3rem; height: 2.3rem;
  display: grid; place-items: center;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 1.05rem;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--rule-strong); }
.icon-btn__dark { display: none; }
:root[data-theme="dark"] .icon-btn__light { display: none; }
:root[data-theme="dark"] .icon-btn__dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn__light { display: none; }
  :root:not([data-theme="light"]) .icon-btn__dark { display: block; }
}

.nav-toggle { display: none; }
.nav-toggle__close { display: none; }
body.nav-open .nav-toggle__open { display: none; }
body.nav-open .nav-toggle__close { display: block; }

.site-footer {
  margin-top: var(--section-y);
  background: var(--surface-alt);
  border-top: 1px solid var(--rule);
  padding-top: 3.5rem;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--gap-lg);
  padding-bottom: 2.5rem;
}
.site-footer__name { font-family: var(--font-serif); font-size: var(--step-1); font-weight: 600; }
.site-footer__meta { color: var(--ink-soft); font-size: var(--step--1); }
.site-footer__heading {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-faint); font-weight: 600; margin-bottom: .8rem;
}
.site-footer__nav li + li { margin-top: .35rem; }
.site-footer__nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--step--1); }
.site-footer__nav a:hover { color: var(--accent); }
.site-footer__bar {
  border-top: 1px solid var(--rule);
  padding-block: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--ink-faint);
}

/* 6. Components ------------------------------------------------------------ */

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .62rem 1.1rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn--primary .icon { transition: transform .2s ease; }
.btn--primary:hover .icon { transform: translateX(3px); }
.btn--ghost { background: var(--surface); border-color: var(--rule-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .22rem .6rem;
  margin-right: .4rem;
  border: 1px solid var(--rule-strong);
  border-radius: 100px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .78rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }

.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.tag {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.tag-list--sm .tag { font-size: .72rem; }

.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 5px;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .02em;
  background: var(--surface-alt);
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
}
.badge--journal    { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.badge--conference { background: var(--warm-tint); border-color: var(--warm); color: var(--warm); }
.badge--thesis     { background: var(--surface-alt); border-color: var(--rule-strong); color: var(--ink); }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--rule-strong); }
.card__title { font-size: var(--step-1); margin-bottom: .5rem; }
.card__title a { color: inherit; text-decoration: none; }
.card__title a:hover { color: var(--accent); }
.card__text { color: var(--ink-soft); font-size: .94rem; }
.card__meta { font-size: .78rem; color: var(--ink-faint); letter-spacing: .02em; margin-bottom: .35rem; }
.card__index {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
  margin-bottom: .9rem;
  letter-spacing: .08em;
}
.card--theme { border-top: 3px solid var(--accent); }

.card--post { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card__cover-link { display: block; }
.card__cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--rule);
}
.card__cover--pattern {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 22% 28%, var(--accent-tint), transparent 55%),
    radial-gradient(circle at 78% 72%, var(--warm-tint), transparent 55%),
    repeating-linear-gradient(45deg, var(--surface-alt) 0 10px, var(--surface) 10px 20px);
}
.card__cover--pattern::after {
  content: attr(data-glyph);
  font-family: var(--font-serif);
  font-size: 2.6rem;
  color: var(--accent);
  opacity: .8;
}
.card--post .card__body { padding: 1.35rem 1.4rem 1.6rem; }

/* Video cards */
.card--video { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card--video .card__body { padding: 1.25rem 1.35rem 1.5rem; }
.card--video .card__meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.card--video .card__title { font-size: 1.08rem; }

.video__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.video__cover img { width: 100%; height: 100%; object-fit: cover; }
.video__cover-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, var(--accent-tint), transparent 60%),
    radial-gradient(circle at 75% 80%, var(--warm-tint), transparent 55%),
    repeating-linear-gradient(115deg, var(--surface-alt) 0 12px, var(--surface) 12px 24px);
}
.video__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.5rem;
  transition: transform .2s ease;
}
.video__play::before {
  content: "";
  position: absolute;
  width: 3.4rem; height: 2.4rem;
  border-radius: 10px;
  background: rgba(200, 32, 32, .92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.video__play .icon { position: relative; }
.card--video:hover .video__play { transform: scale(1.08); }
.video__duration {
  position: absolute;
  right: .55rem; bottom: .55rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-family: var(--font-mono);
  font-size: .72rem;
}

/* Publications */
.pub-list { counter-reset: pub; }
.pub {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
}
.pub:last-child { border-bottom: 1px solid var(--rule); }
.pub__year {
  font-family: var(--font-mono);
  font-size: .84rem;
  font-weight: 500;
  color: var(--ink-faint);
  padding-top: .25rem;
}
.pub__title { font-size: var(--step-1); line-height: 1.3; }
.pub__title a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s ease; }
.pub__title a:hover { color: var(--accent); background-size: 100% 1px; }
.pub__authors { font-size: .9rem; color: var(--ink-soft); margin-top: .35rem; }
.pub__authors strong { color: var(--ink); }
.pub__venue { margin-top: .55rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pub__note { font-size: .82rem; color: var(--warm); font-weight: 500; }
.pub__abstract { font-size: .9rem; color: var(--ink-soft); margin-top: .6rem; }
.pub__links { margin-top: .8rem; display: flex; flex-wrap: wrap; gap: .1rem; }

/* Filter bar */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.filters__label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-faint); font-weight: 600; margin-right: .3rem;
}
.filter-btn {
  padding: .3rem .75rem;
  border-radius: 100px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.search-input {
  flex: 1 1 12rem;
  min-width: 10rem;
  padding: .45rem .8rem;
  border-radius: 8px;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: .88rem;
}
.search-input::placeholder { color: var(--ink-faint); }

.is-hidden { display: none !important; }
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-faint);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
}

/* Timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: .43rem; top: .6rem; bottom: .6rem;
  width: 2px;
  background: linear-gradient(var(--accent), var(--rule));
}
.timeline__item { position: relative; padding-bottom: 2.4rem; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -1.72rem; top: .55rem;
  width: .72rem; height: .72rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__period {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: .04em;
}
.timeline__role { font-size: var(--step-1); margin-top: .3rem; }
.timeline__org { font-size: .92rem; color: var(--ink-soft); margin-top: .15rem; }
.timeline__body { margin-top: .7rem; color: var(--ink-soft); font-size: .94rem; }
.timeline__body ul { list-style: disc; padding-left: 1.2rem; margin-top: .6rem; }
.timeline__body li + li { margin-top: .3rem; }

/* Accordion (teaching) */
.course {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: .7rem;
  overflow: hidden;
}
.course > summary {
  padding: 1rem 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: .8rem;
  flex-wrap: wrap;
  list-style: none;
  font-weight: 600;
  transition: background .15s ease;
}
.course > summary::-webkit-details-marker { display: none; }
.course > summary:hover { background: var(--surface-alt); }
.course > summary::after {
  content: "+";
  margin-left: auto;
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1;
}
.course[open] > summary::after { content: "−"; }
.course[open] > summary { border-bottom: 1px solid var(--rule); background: var(--surface-alt); }
.course__level {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  padding: .12rem .5rem;
  border-radius: 4px;
}
.course__inner { padding: 1.2rem; }
.course__desc { color: var(--ink-soft); font-size: .94rem; margin-bottom: 1rem; }
.course__items { display: grid; gap: .55rem; }
.course__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  padding: .6rem .8rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
}
.course__item-name { font-size: .92rem; font-weight: 500; }
.course__item-links { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.course__item-links .chip { margin-right: 0; }

/* Institution list */
.inst-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.inst { background: var(--surface); padding: 1.4rem 1.3rem; }
.inst__name { font-family: var(--font-serif); font-size: var(--step-1); font-weight: 600; }
.inst__meta { font-size: .82rem; color: var(--ink-faint); margin-top: .25rem; }

/* 7. Page blocks ----------------------------------------------------------- */

.hero { padding-top: clamp(2.5rem, 1rem + 6vw, 5rem); padding-bottom: var(--section-y); }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero__title {
  font-size: var(--step-4);
  letter-spacing: -.03em;
  margin-top: .6rem;
}
.hero__role {
  font-family: var(--font-serif);
  font-size: var(--step-2);
  color: var(--accent);
  font-style: italic;
  margin-top: .3rem;
}
.hero__bio { margin-top: 1.2rem; color: var(--ink-soft); font-size: var(--step-1); line-height: 1.6; max-width: 34em; }

.social-row { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.social-row__link {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-size: .86rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}
.social-row__link:hover { color: var(--accent); }
.social-row__link .icon { font-size: 1.05rem; }

.hero__media { display: grid; gap: 1.2rem; justify-items: center; }
.portrait {
  position: relative;
  width: min(100%, 22rem);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--surface-alt);
  box-shadow: var(--shadow-md);
}
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 55%, color-mix(in srgb, var(--accent) 18%, transparent));
  pointer-events: none;
}
.portrait img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

.status-card {
  width: min(100%, 22rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.status-card__label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-faint); font-weight: 600; margin-bottom: .6rem;
}
.status-card li {
  display: flex;
  gap: .6rem;
  font-size: .87rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.status-card li + li { margin-top: .5rem; }
.status-card__dot {
  width: .45rem; height: .45rem; margin-top: .5rem;
  border-radius: 50%; background: var(--accent); flex: none;
}

.stats { border-block: 1px solid var(--rule); background: var(--paper-tint); }
.stats__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: var(--gap);
  padding-block: 2.2rem;
}
.stat__value {
  font-family: var(--font-serif);
  font-size: var(--step-3);
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.stat__label { font-size: .82rem; color: var(--ink-soft); margin-top: .4rem; }

.cta {
  background: var(--surface-alt);
  border-top: 1px solid var(--rule);
  padding-block: var(--section-y);
}
.cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-lg);
  flex-wrap: wrap;
}
.cta__title { font-size: var(--step-3); }
.cta__text { color: var(--ink-soft); margin-top: .6rem; max-width: 38em; }
.cta .btn-row { margin-top: 0; }

.page-head {
  padding-top: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  padding-bottom: clamp(1.8rem, 1rem + 3vw, 3rem);
}
.page-head__title { font-size: var(--step-4); margin-top: .5rem; letter-spacing: -.025em; }
.page-head__lede {
  font-size: var(--step-1);
  color: var(--ink-soft);
  margin-top: 1rem;
  max-width: 40em;
  line-height: 1.6;
}
.page-head--post { padding-bottom: 1.5rem; }

.post__hero { margin-bottom: 2.5rem; }
.post__hero img { width: 100%; border-radius: var(--radius); border: 1px solid var(--rule); }
.post__hero figcaption { font-size: var(--step--1); color: var(--ink-faint); margin-top: .7rem; text-align: center; }

.post__foot { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
.post__author { display: flex; align-items: center; gap: 1rem; }
.post__author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--rule); }
.post__author-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; }
.post__author-bio { font-size: .85rem; color: var(--ink-soft); }

.post__nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.post__nav-link {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.post__nav-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.post__nav-link--next { text-align: right; }
.post__nav-dir { display: block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.post__nav-title { display: block; margin-top: .3rem; font-family: var(--font-serif); font-weight: 600; color: var(--ink); }

.back-link { margin-top: 3rem; font-size: .9rem; }
.back-link a { text-decoration: none; }
.back-link a:hover { text-decoration: underline; }

/* Talks */
.talks { border-top: 1px solid var(--rule); }
.talk {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.talk__date { font-family: var(--font-mono); font-size: .82rem; color: var(--ink-faint); }
.talk__title { font-size: 1.02rem; font-weight: 600; font-family: var(--font-serif); }
.talk__event { font-size: .88rem; color: var(--ink-soft); margin-top: .2rem; }
.talk__links { margin-top: .5rem; }

/* Beyond work */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--gap); }
.tile {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.6rem 1.4rem;
  overflow: hidden;
}
.tile__glyph {
  font-size: 1.9rem;
  line-height: 1;
  margin-bottom: .9rem;
  display: block;
}
.tile__title { font-size: var(--step-1); }
.tile__text { color: var(--ink-soft); font-size: .93rem; margin-top: .5rem; }

/* Recommended channels */
.card--channel { display: flex; flex-direction: column; gap: .9rem; }
.card__title-link {
  display: flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
  color: inherit;
}
.card__title-link:hover .card__title { color: var(--accent); }
.channel__mark {
  width: 2.6rem; height: 2.6rem;
  flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--rule);
  color: #c82020;
  font-size: 1.15rem;
}
.card--channel .card__title { margin-bottom: 0; transition: color .15s ease; }
.card--channel .card__text { margin: 0; }

.note {
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: .9rem;
}

/* 8. Motion & responsive --------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { justify-items: start; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-md);
    padding: .8rem 1.25rem 1.4rem;
    display: none;
  }
  body.nav-open .nav { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: .1rem; }
  .nav__link { padding: .7rem .8rem; font-size: 1rem; }
  .brand__role { display: none; }
  .pub { grid-template-columns: 1fr; gap: .3rem; }
  .pub__year { padding-top: 0; }
  .talk { grid-template-columns: 1fr; gap: .3rem; }
  .course__item { grid-template-columns: 1fr; }
  .course__item-links { justify-content: flex-start; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .cta__inner { flex-direction: column; align-items: flex-start; }
}

@media print {
  .site-header, .site-footer, .btn-row, .filters, .post__nav { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
