/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #78716c;
  --link: #57534e;
  --link-hover: #1c1917;
  --accent: #456b8f;
  --accent-hover: #375a78;
  --accent-subtle: #e9f0f7;
  --border: #e7e5e4;
  --hero-overlay: rgba(28, 25, 23, 0.45);
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.08), 0 4px 16px rgba(28, 25, 23, 0.04);
  --radius: 12px;
  --max-prose: 720px;
  --max-wide: 960px;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --section-gap: 6rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0a09;
    --surface: #1c1917;
    --text: #fafaf9;
    --text-muted: #a8a29e;
    --link: #a8a29e;
    --link-hover: #fafaf9;
    --accent: #7da3c7;
    --accent-hover: #95b8d4;
    --accent-subtle: #1a2d42;
    --border: #292524;
    --hero-overlay: rgba(12, 10, 9, 0.55);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  }
}

/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

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

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

a:hover { color: var(--link-hover); }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin: 0 0 0.5rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 2rem; }
h3 { font-size: 1.125rem; margin: 0 0 0.75rem; }

p { margin: 0 0 1rem; }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 200;
  text-decoration: none;
}

.skip-link:focus { top: 0; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  width: min(100% - 2rem, var(--max-wide));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2rem, var(--max-prose));
  margin-inline: auto;
}

section {
  padding-block: var(--section-gap);
}

section:nth-child(even) {
  background: var(--surface);
}

/* ── Navigation ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.nav__brand {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav__brand:hover { color: var(--link-hover); }

.nav__links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav__links a:hover,
.nav__links a:focus-visible { color: var(--text); }

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 640px) {
  .nav__toggle { display: block; }

  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    box-shadow: var(--shadow);
  }

  .nav__links.is-open { display: flex; }

  .nav__links a {
    padding: 0.75rem 1.5rem;
    display: block;
  }
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: -2rem;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    var(--hero-overlay) 0%,
    color-mix(in srgb, var(--hero-overlay) 60%, transparent) 50%,
    color-mix(in srgb, var(--hero-overlay) 30%, transparent) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 3;
  padding-block: 3rem;
  color: #fff;
}

.hero__caption {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(100% - 2rem, var(--max-wide));
  z-index: 2;
  pointer-events: none;
  font-size: 0.875rem;
  opacity: 0.85;
  margin: 0;
  font-style: italic;
  color: #fff;
  text-align: right;
}

.hero__content h1 { color: #fff; }

.hero__role {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.hero__affiliation {
  font-size: 1rem;
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.hero__affiliation a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.hero__affiliation a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* ── Tags ────────────────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.tag {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.hero .tag {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Bio ─────────────────────────────────────────────────────── */
.bio {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2.5rem;
  align-items: start;
  max-width: var(--max-wide);
}

.bio__photo {
  width: 220px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.bio__content h2 {
  margin: 0 0 1.5rem;
}

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

.bio a { font-weight: 500; }

@media (max-width: 640px) {
  .bio {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .bio__photo {
    width: min(220px, 65vw);
  }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: var(--font-sans);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn--outline:hover {
  background: var(--accent-subtle);
  color: var(--accent-hover);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ── Section headers ─────────────────────────────────────────── */
.section-header {
  margin-bottom: 2.5rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  max-width: 540px;
}

/* ── Publication cards ───────────────────────────────────────── */
.pub-group { margin-bottom: 3rem; }
.pub-group:last-child { margin-bottom: 0; }

.pub-group__title {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pub-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}

section:nth-child(even) .pub-card {
  background: var(--surface);
}

.pub-card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.pub-card__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.pub-card__year {
  color: var(--accent);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
}

.pub-card__year::after {
  content: " · ";
  color: var(--text-muted);
  font-weight: 400;
}

.pub-card__title a {
  color: var(--text);
}

.pub-card__title a:hover { color: var(--link-hover); }

.pub-card__meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  line-height: 1.35;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.badge--long {
  font-weight: 500;
}

.pub-card__links {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.pub-card__links a { font-weight: 500; }

/* ── Talks timeline ──────────────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2rem;
}

.timeline__item:last-child { padding-bottom: 0; }

.timeline__dot {
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

section:nth-child(even) .timeline__dot {
  border-color: var(--surface);
}

.timeline__year {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.timeline__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.timeline__venue {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

.timeline__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.timeline__tag-group {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline__tag-link {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Contact ─────────────────────────────────────────────────── */
.contact-layout {
  display: grid;
  gap: 2rem;
  max-width: var(--max-wide);
  align-items: start;
}

@media (min-width: 640px) {
  .contact-layout {
    grid-template-columns: 1fr 1.5fr;
    gap: 2.5rem;
  }
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-item h3 {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.contact-item p,
.contact-item address {
  font-style: normal;
  margin: 0;
}

.contact-map-preview {
  width: 100%;
}

.contact-map-preview iframe {
  display: block;
  width: 100%;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (min-width: 640px) {
  .contact-map-preview iframe {
    height: 360px;
  }
}

.contact-map {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.contact-item a {
  word-break: break-all;
}

/* ── CV section ──────────────────────────────────────────────── */
.cv-actions {
  margin-bottom: 0;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer p { margin: 0; }

/* ── Decorative grid (subtle geometry motif) ─────────────────── */
.hero__overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, #fff 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, #fff 4%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.links { font-size: 0.95em; }
.links a { text-decoration: none; margin: 0 0.15em; }
.links a:hover { text-decoration: underline; }
