/* ================================================================
   Aymeric Dieuleveut — v2
   Minimal academic, single typeface, clean grid
   ================================================================ */

:root {
  --bg:          #ffffff;
  --bg-off:      #f7f7f5;
  --text:        #1a1a1a;
  --muted:       #5f6368;
  --light:       #999;
  --border:      #ddd;
  --accent:      #1d3461;   /* deep navy */
  --red:         #b5122a;   /* X red – used sparingly */
  --max:         860px;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --serif:       'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  padding-left: 190px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin-bottom: .9rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ──────────────────────────────────────────────── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ── Top accent bar ──────────────────────────────────────── */
#top-bar {
  position: fixed;
  top: 0;
  left: 190px;
  right: 0;
  height: 3px;
  background: var(--red);
  z-index: 200;
}

/* ── Navigation ──────────────────────────────────────────── */
#site-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 190px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-bottom: none;
  padding: 2.5rem 1.5rem;
  overflow-y: auto;
  z-index: 100;
}
.nav-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
  height: 100%;
}
.nav-home {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.nav-home:hover { text-decoration: none; color: var(--accent); }
.nav-links {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  list-style: none;
}
.nav-links a {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 1px;
}

/* mobile nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle svg { display: block; }

/* ── Page header (home) ──────────────────────────────────── */
#page-header {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}
.header-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.header-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 1px solid var(--border);
}
.header-name {
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: .3rem;
}
.header-title {
  font-size: .95rem;
  color: var(--muted);
  margin-bottom: .2rem;
}
.header-affil {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: .9rem;
}
.header-contact {
  font-size: .88rem;
  color: var(--muted);
}
.header-contact a { color: var(--muted); }
.header-contact a:hover { color: var(--accent); }

.header-links {
  display: flex;
  gap: 1.2rem;
  margin-top: .75rem;
  font-size: .83rem;
  font-weight: 500;
}
.header-links a {
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}
.header-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── Section headers ─────────────────────────────────────── */
.section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}
.section:last-child { border-bottom: none; }

.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 1.4rem;
}

/* ── Bio text ────────────────────────────────────────────── */
#bio p { font-size: .97rem; color: #2a2a2a; }
#bio .research-themes {
  margin-top: 1rem;
  font-size: .88rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.8;
}

/* ── News ────────────────────────────────────────────────── */
.news-list { list-style: none; }
.news-list li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--bg-off);
  font-size: .9rem;
  align-items: baseline;
}
.news-list li:first-child { border-top: 1px solid var(--bg-off); }
.news-date {
  font-size: .78rem;
  color: var(--light);
  font-weight: 600;
  white-space: nowrap;
}
.news-text { color: var(--text); line-height: 1.5; }
.news-text a { color: var(--accent); }
.news-list li.hidden { display: none; }

.show-more-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: .6rem 0 0;
  display: block;
}
.show-more-btn:hover { color: var(--accent); }

/* ── Publications page ───────────────────────────────────── */
.pub-page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.pub-page-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
}
.pub-page-sub {
  font-size: .88rem;
  color: var(--muted);
}

/* Filters */
.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: 1.5rem 0 0;
}
.pub-filters button {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: .28rem .8rem;
  border-radius: 2px;
  cursor: pointer;
  transition: .15s;
}
.pub-filters button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pub-filters button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Publication list */
.pub-section {
  padding: 2rem 0 0;
}
.pub-year-group { margin-bottom: 2.5rem; }
.pub-year-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.pub-item {
  padding: .9rem 0;
  border-bottom: 1px solid var(--bg-off);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem 1.5rem;
  align-items: start;
}
.pub-item:last-child { border-bottom: none; }
.pub-item[hidden] { display: none; }

.pub-title {
  font-size: .96rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: .2rem;
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); text-decoration: none; }
.pub-authors {
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: .25rem;
}
.pub-venue {
  font-size: .83rem;
  color: var(--muted);
  font-style: italic;
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .4rem;
}
.pub-tag {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .12rem .5rem;
  border-radius: 2px;
}
.tag-fl       { background: #dbeafe; color: #1e40af; }
.tag-optim    { background: #dcfce7; color: #166534; }
.tag-cp       { background: #ede9fe; color: #5b21b6; }
.tag-missing  { background: #fef9c3; color: #854d0e; }
.tag-sgd      { background: #ffe4e6; color: #9f1239; }
.tag-decentral{ background: #cffafe; color: #155e75; }
.tag-privacy  { background: #fce7f3; color: #9d174d; }
.tag-theory   { background: #f3f4f6; color: #374151; }
.tag-timeseries { background: #fef3c7; color: #92400e; }

/* Venue-type tags — outlined pill in right column, distinct from filled domain tags */
.tag-conf     { border: 1px solid #1d3461; color: #1d3461; background: transparent; border-radius: 20px; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .72rem; }
.tag-journal  { border: 1px solid #166534; color: #166534; background: transparent; border-radius: 20px; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .72rem; }
.tag-preprint { border: 1px solid #999;    color: #888;    background: transparent; border-radius: 20px; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .72rem; }

.pub-links-inline {
  font-size: .8rem;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  align-items: flex-end;
}
.pub-links-inline a {
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.pub-links-inline a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── Courses page ────────────────────────────────────────── */
.course-item {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--bg-off);
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .5rem 1.2rem;
  align-items: baseline;
}
.course-item:last-child { border-bottom: none; }
.course-period {
  font-size: .78rem;
  font-weight: 600;
  color: var(--light);
  white-space: nowrap;
}
.course-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .2rem;
}
.course-details {
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.5;
}
.course-link { font-size: .82rem; margin-top: .25rem; }

/* ── Talks page ──────────────────────────────────────────── */
.talk-item {
  padding: .9rem 0;
  border-bottom: 1px solid var(--bg-off);
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: .5rem 1.2rem;
  align-items: baseline;
}
.talk-item:last-child { border-bottom: none; }
.talk-year {
  font-size: .78rem;
  font-weight: 600;
  color: var(--light);
}
.talk-title {
  font-size: .93rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: .15rem;
}
.talk-venue {
  font-size: .84rem;
  color: var(--muted);
}
.talk-links { font-size: .82rem; margin-top: .2rem; }
.talk-links a { color: var(--muted); border-bottom: 1px solid var(--border); }
.talk-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

.talk-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.tag-invited  { background: #dbeafe; color: #1e40af; }
.tag-tutorial { background: #ccfbf1; color: #0f766e; }
.tag-panel    { background: #fef3c7; color: #92400e; }

/* ── Generic page header ─────────────────────────────────── */
.page-title {
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .3rem;
}
.page-lead {
  font-size: .9rem;
  color: var(--muted);
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  font-size: .78rem;
  color: var(--light);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 700px) {
  body { padding-left: 0; }
  #top-bar { left: 0; position: relative; height: 3px; }
  #site-nav {
    position: relative;
    width: auto;
    height: auto;
    padding: 1rem 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .nav-inner {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    height: auto;
  }
  .nav-home { font-size: 1.05rem; }
  .wrap { padding: 0 1.2rem; }
  .header-grid { grid-template-columns: 1fr; }
  .header-photo { width: 90px; height: 90px; }
  .course-item,
  .talk-item { grid-template-columns: 1fr; }
  .course-period,
  .talk-year { margin-bottom: .1rem; }
  .pub-item { grid-template-columns: 1fr; }
  .pub-links-inline { flex-direction: row; align-items: flex-start; }
  .nav-links { display: none; flex-direction: column; background: var(--bg); position: absolute; top: 100%; left: 0; right: 0; padding: 1rem 2rem; border-bottom: 1px solid var(--border); z-index: 50; gap: .75rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}
