:root {
  --brown: #2f291a;
  --paper: #f2f0ef;
  --background: #eff1f2;
  --text: #24221e;
  --muted: #69645c;
  --link: #33281f;
  --link-hover: #17120e;
  --highlight: #63351f;
  --line: rgba(47, 41, 26, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--background);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #f2eff0;
}

#navbar {
  position: sticky;
  top: 0;
  z-index: 5000;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  background-color: var(--brown);
  box-shadow: 0 8px 25px rgba(65, 57, 57, 0.2);
}

#navbar a {
  display: block;
  padding: 14px;
  color: #f2f2f2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

#navbar a:hover,
#navbar a:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

main {
  padding: 1px 16px;
}

section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  min-height: 60vh;
  margin: 30px auto;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 15px;
  background: rgba(242, 240, 239, 0.96);
  box-shadow: 0 8px 25px rgba(65, 57, 57, 0.3);
  backdrop-filter: blur(2px);
}

#publications,
#enseignements {
  min-height: 0;
  padding-top: 36px;
  padding-bottom: 36px;
}

#publications > h2,
#enseignements > h2 {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 16px;
  text-align: center;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 3.3rem);
  line-height: 1.15;
}

h2 {
  font-size: 2.15rem;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.1rem;
  line-height: 1.4;
}

h4 {
  margin: 0 0 5px;
  font-size: 1.05rem;
  line-height: 1.45;
}

p {
  margin-bottom: 16px;
}

.section-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.subtitle,
.section-intro {
  color: var(--muted);
  text-align: center;
}

.subtitle {
  margin-top: -10px;
  font-size: 1.12rem;
}

.presentation-card {
  justify-content: space-between;
}

.pres-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  flex: 1;
}

#Image {
  display: block;
  width: 150px;
  height: 150px;
  margin: 0 auto 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.pres-text > p:not(.section-label):not(.subtitle) {
  text-align: left;
}

.pres-text strong {
  color: var(--highlight);
  font-weight: 700;
}

.academic-link {
  display: inline;
  padding: 1px 2px;
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(var(--link), var(--link));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color 0.28s ease, background-size 0.28s ease;
}

.academic-link:hover,
.academic-link:focus-visible {
  color: #fff;
  background-size: 100% 100%;
}

.pres-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
}

.pres-links a,
.email-address {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 2px solid #333;
  border-radius: 20px;
  color: #333;
  font-weight: bold;
  text-decoration: none;
}

.email-address {
  cursor: text;
  user-select: text;
}

.pres-links a {
  transition: 0.3s;
}

.pres-links a:hover {
  color: #fff;
  background: #333;
}

.publication-list,
.teaching-list,
.news-list {
  display: grid;
  gap: 0;
}

.teaching-list {
  gap: 0;
  margin-top: 8px;
}

.publication-group,
.teaching-year {
  margin-top: 24px;
}

.publication-group:first-child,
.teaching-year:first-child {
  margin-top: 0;
}

.group-heading {
  margin-bottom: 5px;
  padding-bottom: 7px;
  border-bottom: 2px solid var(--brown);
  color: var(--brown);
  font-size: 1.22rem;
}

.publication-entry,
.teaching-course {
  padding: 17px 3px;
  border-bottom: 1px solid var(--line);
}

.teaching-course {
  padding: 16px 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.teaching-course h4 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1.04rem;
}

.teaching-course .entry-authors {
  margin-bottom: 0;
  color: #36322d;
  font-size: 0.92rem;
  line-height: 1.5;
}

.publication-title {
  font-size: 1.12rem;
}

.entry-authors {
  margin-bottom: 5px;
  color: #403b35;
  font-size: 0.98rem;
  line-height: 1.55;
}

.publication-entry .entry-authors strong {
  color: var(--highlight);
  font-weight: 800;
}

.publication-venue {
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-style: italic;
}

.publication-note {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.entry-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  line-height: 1.2;
}

.entry-link-item {
  display: inline-flex;
  align-items: baseline;
  color: var(--link);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.article-link {
  color: var(--link);
  font-weight: 700;
  text-decoration-line: underline;
  text-decoration-color: rgba(51, 40, 31, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.article-link:hover,
.article-link:focus-visible {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.publication-entry p:last-of-type,
.news-body p {
  margin-bottom: 8px;
}

.teaching-course p:last-child {
  margin-bottom: 0;
}

.news-entry {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.news-entry h3 {
  margin-bottom: 3px;
}

.news-entry time {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: bold;
}

.reveal {
  opacity: 1;
  transform: none;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 520px) {
  #navbar {
    justify-content: flex-start;
  }

  section {
    min-height: 0;
    padding: 25px 20px;
  }

  .news-entry {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
