/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:        #f8f7f4;
  --bg-dark:   #1e3028;
  --ink:       #1a2e22;
  --ink-muted: #4a6558;
  --green:     #2d4a3e;
  --sage:      #5a8a72;
  --mint:      #c8ddd4;
  --paper:     #f0ede6;
  --border:    #dde8e3;
  --serif:     'DM Serif Display', Georgia, serif;
  --sans:      'DM Sans', system-ui, sans-serif;
}

/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg-dark); }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ─── Nav ─────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 60px;
  background: rgba(248,247,244,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-name {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--green);
}
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--sage); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Hero ────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg-dark);
}
#network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.65;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 120px 80px 80px;
  max-width: 900px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 28px;
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--sage);
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1.05;
  color: #f0ede6;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}
.hero-name em {
  font-style: italic;
  color: var(--mint);
}
.hero-description {
  font-size: 1.125rem;
  color: #b8ccc5;
  max-width: 540px;
  margin-bottom: 48px;
  font-weight: 300;
}
.hero-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary { background: var(--sage); color: #f0ede6; border: 1px solid var(--sage); }
.btn-primary:hover { background: #4a7862; border-color: #4a7862; }
.btn-outline { background: transparent; color: var(--mint); border: 1px solid rgba(200,221,212,0.4); }
.btn-outline:hover { border-color: var(--mint); background: rgba(200,221,212,0.08); }
.hero-scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 80px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a6558;
}
.scroll-line {
  width: 32px;
  height: 1px;
  background: #4a6558;
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:.4;transform:scaleX(1)} 50%{opacity:1;transform:scaleX(1.3)} }

/* ─── Section layouts ─────────────────────────────────────── */
section {
  padding: 100px 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.section-inner { width: 100%; max-width: 1060px; }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 20px;
}
.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--sage);
}
h2.section-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

/* ─── About ───────────────────────────────────────────────── */
#about { background: var(--bg); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  align-items: start;
}
.about-photo-wrap {
  aspect-ratio: 3/4;
  border: 1px solid var(--border);
  overflow: hidden;
}
.about-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.about-text p {
  font-size: 1.05rem;
  color: var(--ink-muted);
  margin-bottom: 20px;
  font-weight: 300;
}
.about-text p strong { color: var(--ink); font-weight: 500; }
.about-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.tag {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--paper);
}

/* ─── Research ────────────────────────────────────────────── */
#research { background: var(--bg-dark); color: #f0ede6; }
#research .section-title { color: #f0ede6; }
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.research-card {
  padding: 40px 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(200,221,212,0.1);
  transition: background 0.2s, border-color 0.2s;
}
.research-card:hover { background: rgba(200,221,212,0.06); border-color: rgba(200,221,212,0.2); }
.rc-number {
  font-family: var(--serif);
  font-size: 2.5rem;
  color: rgba(200,221,212,0.2);
  margin-bottom: 16px;
  line-height: 1;
}
.rc-title { font-family: var(--serif); font-size: 1.25rem; color: #e8f0ec; margin-bottom: 12px; }
.rc-body { font-size: 0.9rem; color: #7aa090; font-weight: 300; line-height: 1.7; }

/* ─── Experience ──────────────────────────────────────────── */
#experience { background: var(--paper); }
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 200px 1px 1fr;
  gap: 0 40px;
  padding-bottom: 48px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-date { text-align: right; padding-top: 4px; }
.tl-date-range { font-size: 0.78rem; font-weight: 500; color: var(--sage); letter-spacing: 0.04em; }
.tl-date-inst { font-size: 0.75rem; color: var(--ink-muted); margin-top: 4px; font-style: italic; }
.tl-spine { position: relative; background: var(--border); }
.tl-spine::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
}
.tl-item:last-child .tl-spine { background: linear-gradient(var(--border), transparent); }
.tl-content { padding-top: 2px; }
.tl-role { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin-bottom: 6px; }
.tl-lab {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 12px;
}
.tl-desc { font-size: 0.9rem; color: var(--ink-muted); font-weight: 300; max-width: 520px; }
.tl-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tl-desc a { color: var(--sage); text-decoration: underline; text-decoration-color: rgba(90,138,114,0.4); }
.tl-desc a:hover { text-decoration-color: var(--sage); }

/* ─── Education ───────────────────────────────────────────── */
#education { background: var(--bg); }
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.edu-card {
  padding: 36px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: border-color 0.2s, transform 0.2s;
}
.edu-card:hover { border-color: var(--sage); transform: translateY(-2px); }
.edu-degree { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); margin-bottom: 6px; }
.edu-inst { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sage); margin-bottom: 10px; }
.edu-year { font-size: 0.8rem; color: var(--ink-muted); }
.edu-detail { margin-top: 14px; font-size: 0.88rem; color: var(--ink-muted); font-weight: 300; }

/* ─── Publications ────────────────────────────────────────── */
#publications { background: var(--bg-dark); color: #f0ede6; }
#publications .section-title { color: #f0ede6; }
.pub-note { font-size: 0.78rem; color: #7aa090; font-weight: 300; margin-bottom: 32px; margin-top: -32px; }
.pub-list { display: flex; flex-direction: column; gap: 2px; }
.pub-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 28px 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(200,221,212,0.08);
  transition: background 0.2s;
  cursor: default;
}
a.pub-item { cursor: pointer; }
.pub-item:hover { background: rgba(200,221,212,0.05); }
.pub-idx { font-family: var(--serif); font-size: 1.4rem; color: rgba(200,221,212,0.2); line-height: 1.2; padding-top: 4px; }
.pub-title { font-size: 0.95rem; font-weight: 400; color: #e8f0ec; margin-bottom: 6px; line-height: 1.5; }
.pub-meta { font-size: 0.78rem; color: #7aa090; font-weight: 300; }
.pub-journal {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(90,138,114,0.15);
  border: 1px solid rgba(90,138,114,0.2);
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--sage);
  white-space: nowrap;
  height: fit-content;
  margin-top: 4px;
}
.pub-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(200,221,212,0.08);
  border: 1px solid rgba(200,221,212,0.15);
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #b8ccc5;
  white-space: nowrap;
  height: fit-content;
  margin-top: 4px;
}

/* ─── CV / Contact ────────────────────────────────────────── */
#cv { background: var(--bg); }
.cv-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
.cv-text h2 { margin-bottom: 20px; }
.cv-text p { font-size: 1rem; color: var(--ink-muted); font-weight: 300; margin-bottom: 32px; }
.cv-links { display: flex; flex-direction: column; gap: 12px; }
.cv-link-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  background: var(--paper);
  transition: border-color 0.2s, transform 0.2s;
}
.cv-link-item:hover { border-color: var(--sage); transform: translateX(4px); }
.cv-link-icon {
  width: 34px;
  height: 34px;
  background: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green);
}
.cv-link-label { font-size: 0.85rem; font-weight: 500; color: var(--ink); }
.cv-link-sub { font-size: 0.75rem; color: var(--ink-muted); margin-top: 1px; }

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  background: var(--bg-dark);
  padding: 40px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-name { font-family: var(--serif); font-size: 1rem; color: #e8f0ec; }
.footer-copy { font-size: 0.75rem; color: #4a6558; }

/* ─── Scroll reveal ───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── Output page ─────────────────────────────────────────── */
.pub-section {
  padding: 80px;
}
.pub-section-inner {
  max-width: 1060px;
  margin: 0 auto;
}
.pub-section:nth-child(even) { background: var(--paper); }

.pub-section .section-label { margin-bottom: 12px; }

.pub-section h2.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 48px;
}

.pub-entry {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.pub-entry.visible { opacity: 1; transform: translateY(0); }
.pub-entry:first-child { border-top: 1px solid var(--border); }

.pub-year {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sage);
  letter-spacing: 0.04em;
  padding-top: 3px;
}

/* Scoped to .pub-entry to avoid conflicting with the dark-bg .pub-title on index.html */
.pub-entry .pub-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 8px;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-weight: 300;
  margin-bottom: 6px;
}
.pub-authors strong { font-weight: 600; color: var(--ink); }

.pub-abstract {
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-weight: 300;
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 16px;
  display: none;
}
.pub-abstract.open { display: block; }

.pub-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.pub-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-journal { background: rgba(90,138,114,0.12); border: 1px solid rgba(90,138,114,0.25); color: var(--sage); }
.badge-preprint { background: rgba(200,221,212,0.15); border: 1px solid rgba(200,221,212,0.3); color: var(--ink-muted); }

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sage);
  letter-spacing: 0.04em;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.pub-link:hover { border-bottom-color: var(--sage); }
.pub-link svg { flex-shrink: 0; }

.abstract-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  font-family: var(--sans);
  padding: 4px 0;
  transition: color 0.15s;
}
.abstract-toggle:hover { color: var(--sage); }
.toggle-arrow { display: inline-block; transition: transform 0.2s; font-style: normal; }
.abstract-toggle.open .toggle-arrow { transform: rotate(180deg); }

.conf-entry {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.conf-entry.visible { opacity: 1; transform: translateY(0); }
.conf-entry:first-child { border-top: 1px solid var(--border); }

.conf-year { font-size: 0.78rem; font-weight: 600; color: var(--sage); letter-spacing: 0.04em; padding-top: 3px; }
.conf-title { font-size: 0.95rem; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.conf-event { font-size: 0.82rem; color: var(--ink-muted); font-weight: 300; }
.conf-location { font-size: 0.78rem; color: var(--ink-muted); font-weight: 300; font-style: italic; }

.conf-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sage);
  letter-spacing: 0.04em;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.conf-link:hover { border-bottom-color: var(--sage); }

.conf-type {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.type-talk { background: rgba(45,74,62,0.1); border: 1px solid rgba(45,74,62,0.2); color: var(--green); }
.type-poster { background: rgba(200,221,212,0.2); border: 1px solid rgba(200,221,212,0.4); color: var(--ink-muted); }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 1060px) and (min-width: 861px) {
  .research-grid { grid-template-columns: 1fr 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  section { padding: 80px 48px; }
}
@media (max-width: 860px) {
  html { scroll-padding-top: calc(60px + env(safe-area-inset-top)); }
  body { background: var(--bg-dark); }
  section { min-height: auto; justify-content: flex-start; padding: 60px 24px 40px; }
  nav { position: fixed; width: 100%; padding: env(safe-area-inset-top) 24px 0; height: calc(60px + env(safe-area-inset-top)); background: var(--bg); }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: calc(60px + env(safe-area-inset-top));
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(248,247,244,0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a { display: block; padding: 14px 0; font-size: 0.85rem; }
  #hero { min-height: 100dvh; }
  .hero-content { padding: calc(80px + env(safe-area-inset-top)) 24px 60px; }
  .hero-scroll-hint { left: 24px; }
  .about-grid, .cv-inner, .edu-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-photo-wrap { max-width: 260px; }
  .research-grid { grid-template-columns: 1fr; }
  .tl-item { grid-template-columns: 1fr; gap: 8px; }
  .tl-date { text-align: left; }
  .tl-spine { display: none; }
  .pub-item { grid-template-columns: 1fr; gap: 12px; }
  .pub-idx { display: none; }
  footer { flex-direction: column; gap: 12px; padding: 32px 24px 80px; text-align: center; }
  .pub-section { padding: 64px 24px; }
  .pub-entry { grid-template-columns: 44px 1fr; gap: 16px; }
  .conf-entry { grid-template-columns: 44px 1fr; gap: 8px 16px; }
  .conf-type { grid-column: 2; margin-top: 4px; }
}
