/* ===== Tokens ===== */

:root {
  --font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --text: #1a1f29;
  --muted: #5b6472;
  --accent: #1f3a60;          /* navy */
  --accent-soft: #e8eef7;
  --border: #e4e7ec;
  --header-bg: rgba(255, 255, 255, 0.88);

  --container: 58rem;
  --header-h: 3.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151c;
    --bg-alt: #171c25;
    --text: #e6e9ee;
    --muted: #a0a8b5;
    --accent: #9dbbe6;
    --accent-soft: #1f2a3b;
    --border: #2a313d;
    --header-bg: rgba(17, 21, 28, 0.88);
  }
}

/* ===== Base ===== */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}

p { margin: 0 0 1rem; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

address { font-style: normal; }

.muted { color: var(--muted); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section[id] { scroll-margin-top: calc(var(--header-h) + 0.5rem); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--text);
}

.skip-link:focus { left: 1rem; top: 1rem; }

/* ===== Header ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.nav-link {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.25rem 0;
}

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

.nav-link.active { color: var(--accent); }

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.2rem;
  height: 2px;
  background: var(--accent);
}

.nav-cv {
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
}

.nav-cv:hover { background: var(--accent); color: var(--bg); }

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.6rem;
  background: none;
  border: 0;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--text);
  transition: transform 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ===== Hero / About ===== */

.hero {
  padding: 4.5rem 0 4rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 3.5rem;
  align-items: start;
}

.hero-name {
  font-size: clamp(2.2rem, 4.5vw, 2.9rem);
  letter-spacing: -0.01em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.hero-role {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.hero-text > p:not(.hero-role) { max-width: 38rem; }

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.fields {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 1.75rem;
  padding: 0;
}

.fields li {
  font-size: 0.85rem;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ===== Buttons ===== */

.button {
  display: inline-block;
  padding: 0.6rem 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.button-primary { background: var(--accent); color: var(--bg); }
.button-primary:hover { opacity: 0.9; }

.button-ghost { color: var(--accent); }
.button-ghost:hover { background: var(--accent-soft); }

/* ===== Sections ===== */

.section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}

.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

/* ===== Research ===== */

.group-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.5rem 0 0.25rem;
}

.papers {
  list-style: none;
  margin: 0;
  padding: 0;
}

.paper {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--border);
}

.paper:last-child { border-bottom: 0; }

.paper-title {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.paper-title a {
  color: var(--text);
  text-decoration: none;
}

.paper-title a:hover { color: var(--accent); text-decoration: underline; }

.paper-meta {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.venue { color: var(--accent); font-weight: 500; }

.paper-abstract {
  font-size: 0.98rem;
  max-width: 44rem;
  margin-bottom: 0.75rem;
}

.papers-compact .paper-title { font-size: 1.08rem; }
.papers-compact .paper-abstract { color: var(--muted); margin-bottom: 0; }

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.pill {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
}

.pill:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ===== Contact ===== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.contact-label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.contact-grid p { margin: 0; }

/* ===== Footer ===== */

.site-footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.site-footer p { margin: 0; }

/* ===== Responsive ===== */

@media (max-width: 760px) {
  .hero { padding: 2.5rem 0 3rem; }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .hero-photo { order: -1; }

  .hero-photo img {
    width: 8.5rem;
    border-radius: 999px;
  }

  .section { padding: 3rem 0; }

  .nav-toggle { display: block; }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
  }

  .nav-list.open { display: flex; }

  .nav-list li { width: 100%; }

  .nav-link { display: block; padding: 0.65rem 0; }
  .nav-link.active::after { display: none; }

  .nav-cv { display: inline-block; margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .site-header, .hero-actions, .paper-links, .skip-link { display: none; }
  .section { border: 0; padding: 1.5rem 0; }
  a { color: inherit; text-decoration: none; }
}
