/* ============================================================
   Sébastien Célestin — academic site
   ============================================================ */

:root {
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --text: #1c2027;
  --text-muted: #5b6472;
  --text-faint: #8a919e;
  --border: #e7e4de;
  --accent: #1e3a6e;
  --accent-strong: #14294f;
  --accent-soft: #eef2f8;
  --link: #1e3a6e;
  --max-width: 880px;
  --radius: 10px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--accent-strong);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; margin-top: 2.4em; }
h3 { font-size: 1.15rem; margin-top: 1.6em; }

p { margin: 0 0 1em; }

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 58, 110, 0.28);
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-color: var(--link); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / nav ---------- */

header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent-strong);
  border-bottom: none;
  white-space: nowrap;
}
.brand:hover { border-bottom: none; }

nav.site-nav {
  display: flex;
  gap: 28px;
}

nav.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: none;
  padding: 4px 0;
}
nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--accent-strong);
}
nav.site-nav a.active {
  border-bottom: 2px solid var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 40px;
  height: 36px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--accent-strong);
  position: relative;
  transition: 0.2s;
}
.nav-toggle span::before { position: absolute; top: -6px; width: 18px; }
.nav-toggle span::after { position: absolute; top: 6px; width: 18px; }

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  nav.site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  nav.site-nav.open { max-height: 240px; }
  nav.site-nav a {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  nav.site-nav a.active { border-left: 3px solid var(--accent); border-bottom: 1px solid var(--border); }
}

/* ---------- Hero ---------- */

.hero {
  padding: 56px 0 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 36px;
  align-items: start;
}

.hero-photo img {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(20, 41, 79, 0.08);
}

.hero-text .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.hero-text h1 { margin-bottom: 4px; }

.hero-title {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.hero-title strong { color: var(--text); font-weight: 600; }

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.contact-line a { color: var(--text-muted); }

@media (max-width: 560px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-photo { display: flex; justify-content: center; }
  .contact-line { justify-content: center; }
}

/* ---------- Affiliation strip ---------- */

.affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  padding: 22px 0 6px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.affiliations img {
  height: 34px;
  width: auto;
  opacity: 0.85;
  filter: grayscale(15%);
}

/* ---------- Sections / cards ---------- */

section.block { margin: 2.2em 0; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
}

ul.plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.plain li {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.96rem;
}
ul.plain li:last-child { border-bottom: none; }
ul.plain li::before {
  content: "—";
  color: var(--text-faint);
  margin-right: 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head a.see-all {
  font-size: 0.9rem;
  border-bottom: none;
  white-space: nowrap;
}

/* ---------- Publications ---------- */

.pub-year-group { margin-bottom: 8px; }

.pub-year-heading {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  margin: 2em 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent-soft);
}

.pub-category-title {
  font-size: 1.05rem;
  margin-top: 2.2em;
  color: var(--accent-strong);
}

.pub-entry {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.97rem;
}
.pub-entry:last-child { border-bottom: none; }

.pub-entry .pub-authors { color: var(--text); }
.pub-entry .pub-authors .me { font-weight: 600; }

.pub-entry .pub-venue {
  color: var(--text-muted);
  font-style: italic;
}

.pub-links {
  margin-top: 6px;
  display: flex;
  gap: 14px;
  font-size: 0.86rem;
}
.pub-links a {
  border-bottom: none;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.pub-links a:hover { background: var(--accent); color: #fff; }

.pub-note {
  color: var(--text-faint);
  font-size: 0.86rem;
  margin-top: 6px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.filter-row button {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}
.filter-row button.active,
.filter-row button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- Teaching ---------- */

details.year-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 12px;
  overflow: hidden;
}
details.year-block > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.year-block > summary::-webkit-details-marker { display: none; }
details.year-block > summary::after {
  content: "+";
  font-family: var(--sans);
  font-size: 1.3rem;
  color: var(--text-faint);
  font-weight: 400;
}
details.year-block[open] > summary::after { content: "–"; }
details.year-block .year-body {
  padding: 4px 20px 18px;
  border-top: 1px solid var(--border);
}

.semester-title {
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 8px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.course {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.course:last-child { border-bottom: none; }
.course .course-title { font-weight: 600; color: var(--text); }
.course .course-meta { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Footer ---------- */

footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding: 34px 0 46px;
  color: var(--text-faint);
  font-size: 0.88rem;
}
footer .footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
footer a { color: var(--text-muted); }

/* ---------- Misc ---------- */

/* ---------- Timeline (positions, projects, awards) ---------- */

.timeline-row {
  display: flex;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-row:last-child { border-bottom: none; }

.timeline-date {
  flex: 0 0 128px;
  color: var(--text-faint);
  font-size: 0.85rem;
  font-weight: 600;
  padding-top: 2px;
}

.timeline-body .role {
  color: var(--text);
  font-weight: 600;
}
.timeline-body .org {
  color: var(--text-muted);
  font-size: 0.92rem;
}
.timeline-body .desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

@media (max-width: 560px) {
  .timeline-row { flex-direction: column; gap: 2px; }
  .timeline-date { flex: none; }
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.award-line {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0;
}
.award-line .year {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  flex: 0 0 auto;
}

.talk-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
  color: var(--text-muted);
}
.talk-entry:last-child { border-bottom: none; }
.talk-entry .talk-title { color: var(--text); font-weight: 500; }

.placeholder-note {
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--accent-strong);
  margin: 1.4em 0;
}
