:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1d2327;
  --muted: #5b6670;
  --line: #e4e1da;
  --accent: #2f5d50;
  --accent-soft: #e6efeb;
  --radius: 14px;
  --max: 1040px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

/* Header and navigation */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px;
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.menu-btn {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font: inherit; color: var(--ink); cursor: pointer;
}

@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px 14px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 10px; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
}

/* Sections */
main { padding: 48px 0 72px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.25; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: 0 0 12px; }
h2 { font-size: 1.55rem; margin: 48px 0 14px; }
h3 { font-size: 1.15rem; margin: 0 0 6px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 680px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--accent); font-weight: 600; margin: 0 0 8px; }

/* Hero */
.hero { display: grid; grid-template-columns: 1fr 260px; gap: 48px; align-items: center; }
.portrait {
  width: 260px; aspect-ratio: 1; border-radius: 50%; object-fit: cover;
  background: var(--accent-soft); border: 6px solid var(--surface);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero .portrait { width: 160px; order: -1; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px;
  background: var(--accent); color: #fff; text-decoration: none; font-weight: 600;
}
.btn:hover { background: #244a40; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); }

/* Cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.card p { margin: 0; color: var(--muted); }
a.card { text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .more { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 600; }

/* Lists of publications and CV entries */
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.pubs .title { font-weight: 600; }
.pubs .meta { color: var(--muted); font-size: 0.95rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.tags li { background: var(--accent-soft); color: var(--accent); padding: 4px 12px; border-radius: 99px; font-size: 0.9rem; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline .when { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* Gallery */
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img, .gallery .ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery .ph { background: linear-gradient(135deg, #cfe0d6, #8fb3a3); }
.gallery figcaption { padding: 12px 16px; font-size: 0.95rem; }
.gallery figcaption span { display: block; color: var(--muted); font-size: 0.88rem; }

.note {
  background: #fff8e6; border: 1px solid #f0dfb0; border-radius: 10px;
  padding: 12px 16px; font-size: 0.92rem; color: #6b5420;
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a { color: var(--muted); }

.grid.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .grid.two { grid-template-columns: 1fr; } }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid.three { grid-template-columns: 1fr; } }
