/* ── Custom properties ─────────────────────────────── */
:root {
  --bg: #faf8f5;
  --text: #1a1a1a;
  --text-muted: #555;
  --accent: #5b8cb5;
  --accent-light: #e8f0f7;
  --max-w: 48rem;
  --nav-h: 3.2rem;
  --font: "EB Garamond", Georgia, serif;
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1.5rem);
}

body {
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

ul { list-style: none; }

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

/* ── Skip link ────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 4px 4px;
  z-index: 200;
  font-size: 0.9rem;
}
.skip-link:focus { top: 0; }

/* ── Hero ─────────────────────────────────────────── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.hero__photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.25rem;
}

.hero__name {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0.25rem;
}

.hero__tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hero__affiliation {
  font-size: 1rem;
  color: var(--text-muted);
}

/* ── Nav ──────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid #ddd;
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__links {
  display: flex;
  gap: 1.5rem;
}

.nav__links a {
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav__links a:hover,
.nav__links a.active {
  text-decoration: none;
  border-bottom-color: var(--accent);
}

.nav__cv {
  font-weight: 600;
}

.nav__icons {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.nav__icons a {
  color: var(--text-muted);
  display: flex;
  transition: color 0.2s;
}

.nav__icons a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ── Hamburger (mobile only) ─────────────────────── */
.nav__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 22px;
  position: relative;
  z-index: 110;
}

.nav__hamburger span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav__hamburger span:nth-child(1) { top: 0; }
.nav__hamburger span:nth-child(2) { top: 10px; }
.nav__hamburger span:nth-child(3) { top: 20px; }

/* Open state */
.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* ── Sections ─────────────────────────────────────── */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.section + .section {
  border-top: 1.5px solid #ddd;
}

.section__heading {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.section p + p {
  margin-top: 0.75rem;
}

.section__full-list {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Journey map ─────────────────────────────────── */
#journey-map {
  margin-top: 1.5rem;
}

.journey-map {
  width: 100%;
  height: auto;
  display: block;
}

.journey-city {
  font: 14px/1 var(--font);
  fill: var(--text);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.journey-year {
  font: italic 10px/1 var(--font);
  fill: var(--text-muted);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
  stroke-linejoin: round;
}

/* ── Research entries ─────────────────────────────── */
.research__theme {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.research__theme::before {
  content: "⁕";
  display: block;
  text-align: center;
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.research__theme:first-of-type::before {
  display: none;
}

.research__theme-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.paper {
  border-left: 3px solid var(--accent);
  padding: 0.6rem 0 0.6rem 1rem;
  margin: 0.75rem 0;
}

.paper__title {
  font-weight: 600;
  line-height: 1.4;
}

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

.paper__title a:hover {
  color: var(--accent);
}

.paper__authors {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.paper__desc {
  font-size: 0.95rem;
  margin-top: 0.3rem;
  color: var(--text-muted);
}

/* ── Software / Writing projects ─────────────────── */
.project {
  margin: 1.25rem 0;
}

.project__name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

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

.project__name a:hover {
  color: var(--accent);
}

.project p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.project ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.project li + li {
  margin-top: 0.25rem;
}

/* ── Footer ───────────────────────────────────────── */
.footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  border-top: 1.5px solid #ddd;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.footer__personal {
  margin-top: 0.4rem;
  font-style: italic;
}

/* ── Responsive (≤768px) ─────────────────────────── */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 1.25rem 1.5rem;
  }

  .hero__photo {
    width: 120px;
    height: 120px;
  }

  .hero__name {
    font-size: 1.6rem;
  }

  .nav__hamburger {
    display: block;
  }

  .nav__links,
  .nav__icons {
    display: none;
  }

  /* Mobile menu open */
  .nav.open .nav__links,
  .nav.open .nav__icons {
    display: flex;
  }

  .nav.open .nav__inner {
    flex-wrap: wrap;
    height: auto;
    padding-bottom: 0.75rem;
  }

  .nav.open .nav__links {
    flex-direction: column;
    width: 100%;
    gap: 0.4rem;
    padding-top: 0.5rem;
  }

  .nav.open .nav__links a {
    font-size: 1.05rem;
    padding: 0.35rem 0;
  }

  .nav.open .nav__icons {
    width: 100%;
    justify-content: center;
    gap: 1.25rem;
    padding-top: 0.5rem;
    border-top: 1.5px solid #ddd;
  }

  .section {
    padding: 2rem 1.25rem;
  }

  .section__heading {
    font-size: 1.3rem;
  }

  body {
    font-size: 1.05rem;
  }
}
