:root {
  color-scheme: light;
  --ink: #222;
  --muted: #666;
  --line: #ddd;
  --link: #0645ad;
  --content-width: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 14px/1.55 "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: normal;
  word-spacing: normal;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

a:focus-visible {
  outline: 2px solid rgb(6 69 173 / 35%);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: .6rem;
  left: .6rem;
  z-index: 10;
  padding: .4rem .65rem;
  background: #222;
  color: #fff;
  transform: translateY(-180%);
}

.skip-link:focus { color: #fff; transform: translateY(0); }

main,
.site-footer {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}

main > section {
  padding-block: 1.45rem;
  scroll-margin-top: 1rem;
}

#news { padding-top: 0; }

.profile {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 1.8rem;
  align-items: start;
  padding-top: 2.6rem;
  padding-bottom: 1.7rem;
}

.profile-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
}

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

h1 {
  margin-bottom: .05rem;
  font-size: 1.45rem;
  line-height: 1.25;
}

h2 {
  margin-bottom: .8rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

h3 {
  margin-bottom: .08rem;
  font-size: .95rem;
  line-height: 1.4;
}

strong { font-weight: 400; }

.position {
  margin-bottom: .75rem;
  color: var(--muted);
}

.profile-bio {
  grid-column: 1 / -1;
}

.profile-bio > p:not(.profile-links) {
  margin-bottom: .75rem;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: .1rem .4rem;
  margin-bottom: 0;
  font-size: .88rem;
}

.cv-link.is-pending {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: underline dotted;
}

.dated-list,
.timeline-list,
.compact-list,
.publication-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dated-list { display: grid; gap: .25rem; }

.dated-list li {
  display: grid;
  grid-template-columns: 5.7rem minmax(0, 1fr);
  gap: .7rem;
}

.dated-list time,
.timeline-list time,
.compact-list time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.section-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.section-heading-row h2 { margin-bottom: 0; }
.section-link { flex: 0 0 auto; font-size: .8rem; }

.publication-list > li { margin-bottom: 1.05rem; }
.publication-list > li:last-child { margin-bottom: 0; }
.publication-list h3 { font-weight: 400; }

.authors,
.venue {
  margin-bottom: 0;
  font-size: .88rem;
}

.authors { color: var(--muted); }
.authors strong { color: var(--ink); }
.venue { color: var(--muted); }

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .12rem 0 0;
  font-size: .82rem;
}

.paper-links a::before { content: "["; }
.paper-links a::after { content: "]"; }

.timeline-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding-block: .25rem;
}

.timeline-list div { display: grid; }
.timeline-list span { color: var(--muted); font-size: .88rem; }

.internship-note {
  margin: .7rem 0 0;
  color: var(--ink);
  font-size: .88rem;
}

.internship-note-label { font-weight: 600; }

.expandable-details { margin-top: .8rem; }

.news-more { margin-top: 0; }
.news-more summary { padding-block: 0; }

.expandable-details summary {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: .05rem;
  padding-block: .25rem;
  cursor: pointer;
  font-weight: 400;
  list-style: none;
}

.expandable-details summary::-webkit-details-marker { display: none; }

.details-action {
  color: var(--link);
  font-size: .78rem;
  font-weight: 400;
}

.when-open { display: none; }
.expandable-details[open] .when-open { display: inline; }
.expandable-details[open] .when-closed { display: none; }
.expandable-details[open] .timeline-list { padding-top: .35rem; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.3rem;
}

.service-grid h3 { margin-bottom: .4rem; }

.compact-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .7rem;
  padding-block: .18rem;
  font-size: .86rem;
}

.contact p { margin-bottom: 0; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .8rem;
  padding: 1rem 0 2.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}

.site-footer p { margin-bottom: 0; }

@media (max-width: 600px) {
  .profile {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 1.1rem;
  }

  .service-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .dated-list li, .timeline-list li { grid-template-columns: 1fr; gap: 0; }
  .dated-list time, .timeline-list time { grid-row: 1; }
  .section-heading-row { align-items: flex-start; flex-direction: column; gap: .15rem; }
}

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

@media print {
  body { color: #000; font-size: 10pt; }
  .skip-link, .site-footer a { display: none; }
  main, .site-footer { width: 100%; }
  main > section { padding-block: .75rem; break-inside: avoid; }
  a { color: #000; }
}
