/* ── Fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Lato';
  font-style: italic; font-weight: 400;
  src: local('Lato Italic'), url(https://fonts.gstatic.com/s/lato/v15/S6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal; font-weight: 400;
  src: local('Lato Regular'), url(https://fonts.gstatic.com/s/lato/v15/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
}
@font-face {
  font-family: 'Lato';
  font-style: normal; font-weight: 700;
  src: local('Lato Bold'), url(https://fonts.gstatic.com/s/lato/v15/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
}

/* ── Palette ────────────────────────────────────────────
   bg           #e6e6e6
   olive-mid    #7b9669
   text-dark    #404e3b
   sage-light   #bac8b1
   slate-green  #6c8480
   ───────────────────────────────────────────────────── */

:root {
  --bg: #e6e6e6;
  --surface: #f1f3ef;
  --surface-soft: #dde4d7;
  --accent-dark: #404e3b;
  --accent-mid: #6c8480;
  --accent-light: #bac8b1;
  --accent-pale: #d7ddd2;
  --accent-pale-strong: #cad4c3;
  --text: #404e3b;
  --link: #2f3d2b;
  --link-hover: #556e49;
  --muted: #6c8480;
  --line: #bac8b1;
  --line-strong: #aab9a2;
}

/* ── Base ───────────────────────────────────────────────── */
html, body { background: var(--bg); }

body {
  max-width: 980px;
  margin: 0 auto;
  color: var(--text);
}

body, td, th, tr, p, a {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
}

strong { font-family: 'Lato', Verdana, Helvetica, sans-serif; font-size: 14px; }

a { color: var(--link); text-decoration: none; }
a:hover, a:focus { color: var(--link-hover); text-decoration: none; }

/* ── Nav ────────────────────────────────────────────────── */
nav {
  background: var(--bg);
  padding-top: 4px;
}

nav ul {
  list-style: none;
  margin: 0 auto;
  padding: 0 24px;
  max-width: 980px;
  display: flex;
  gap: 2px;
  align-items: center;
}

nav ul li a {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  padding: 13px 16px;
  display: block;
  transition: color 0.15s ease;
}

nav ul li a:hover {
  color: var(--accent-mid);
}

nav ul li a.active {
  color: var(--accent-dark);
  font-weight: 700;
}

/* Nav icon (rightmost) */
nav ul li.nav-icon {
  margin-left: auto;
}

nav ul li.nav-icon img {
  width: 28px;
  height: 28px;
  display: block;
  opacity: 0.85;
}

/* ── Typography ─────────────────────────────────────────── */
h2 {
  margin: 0 0 4px;
  font-weight: 700;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 20px;
  color: var(--accent-dark);
  display: inline-block;
}

.name {
  padding-top: 20px;
  margin: 0;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 32px;
  color: var(--accent-dark);
}

.subtitle {
  text-align: center;
  font-size: 15px;
  color: var(--accent-mid);
  margin: 4px 0 10px;
  font-style: italic;
}

/* ── Publications ───────────────────────────────────────── */
.papertitle {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

/* Paper image column */
.paper-img {
  width: 200px;
  min-width: 200px;
}
.paper-img img {
  width: 200px;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* Row separation: whitespace only — no lines */
tr.pub td {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* Hover: scale the two cells together from the row's midpoint */
tr.pub td {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  transform-origin: center center;
}
tr.pub:hover td {
  transform: scale(1.025);
  box-shadow: 0 6px 18px rgba(85,111,120,0.10);
  background-color: var(--surface);
}
tr.pub:hover td:first-child {
  border-radius: 6px 0 0 6px;
}
tr.pub:hover td:last-child {
  border-radius: 0 6px 6px 0;
}

/* Selected papers: light teal tint — kept as-is */
tr.pub-selected {
  background-color: var(--accent-pale) !important;
}
tr.pub-selected:hover td {
  background-color: var(--accent-pale-strong) !important;
}

/* Text spacing inside paper entries */
tr.pub td:last-child {
  padding: 14px 10px 14px 12px;
  vertical-align: top;
  line-height: 1.75;
}

tr.pub td:last-child p {
  margin: 8px 0 0;
  color: #556552;
  line-height: 1.6;
}

/* ── Publication tabs ───────────────────────────────────── */
.pub-tabs {
  margin-top: 12px;
  display: flex;
  gap: 6px;
}

.pub-tab {
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 13px;
  padding: 4px 16px;
  border: 1.5px solid var(--accent-mid);
  border-radius: 3px;
  background: var(--surface);
  color: var(--accent-mid);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pub-tab:hover { background: var(--accent-pale); }

.pub-tab.active {
  background: var(--accent-mid);
  color: var(--surface);
}

/* ── Publication link buttons ───────────────────────────── */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  align-items: flex-start;
}

.pub-link-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'Lato', Verdana, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 18px 4px 0;
  border: none;
  text-decoration: none;
  line-height: 1.15;
  transition: color 0.15s ease;
}

.pub-link-btn::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(100% - 10px);
  height: 1.5px;
  background: currentColor;
  opacity: 0.38;
  transform: scaleX(0.3);
  transform-origin: left center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

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

.pub-link-btn:hover::after {
  opacity: 0.95;
  transform: scaleX(1);
}

.pub-link-btn.project { color: #404e3b; }
.pub-link-btn.arxiv { color: #6c8480; }
.pub-link-btn.paper { color: #6c8480; }
.pub-link-btn.dataset { color: #7b9669; }

@media (max-width: 640px) {
  .pub-links {
    gap: 12px;
  }

  .pub-link-btn {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
}

/* ── CV timeline ────────────────────────────────────────── */
.cv-section {
  padding: 16px 32px 4px;
}

.cv-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 16px;
  padding-bottom: 5px;
  border-bottom: 1.5px solid var(--line-strong);
}

.timeline {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--accent-pale-strong);
  margin-bottom: 8px;
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.timeline-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-mid);
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.timeline-org {
  font-size: 13px;
  color: #4d5d49;
  margin-top: 1px;
}

.timeline-sub {
  font-size: 13px;
  color: #62736f;
  margin-top: 3px;
  line-height: 1.5;
}

.cv-download-wrap {
  padding: 8px 32px 32px;
}

.cv-download-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-dark);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--surface);
}

.cv-download-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.cv-download-copy {
  color: var(--muted);
  margin-bottom: 10px;
}

.cv-download-link {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #404e3b;
}

/* ── Projects page ──────────────────────────────────────── */
.project-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.project-list li {
  position: relative;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-dark);
  padding: 16px 18px 16px 20px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border-radius: 0 8px 8px 0;
  line-height: 1.75;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transform: none;
  transition: none;
}

.project-list li:hover {
  transform: none;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border-color: var(--line);
  border-left-color: var(--accent-dark);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.project-list li strong {
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
  color: #404e3b;
  letter-spacing: 0.01em;
}

.project-list li .tech {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── Field work gallery ─────────────────────────────────── */
.fieldwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 8px 0 16px;
}

.fieldwork-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fieldwork-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(85,111,120,0.16);
}

@media (max-width: 640px) {
  .cv-download-wrap {
    padding: 8px 24px 28px;
  }

  .fieldwork-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .fieldwork-grid img {
    height: 200px;
  }
}

/* ── Section divider ────────────────────────────────────── */
.section-pad { padding: 16px 24px 8px; }

/* ── Footer ─────────────────────────────────────────────── */
.footer-cell {
  padding: 20px 0 20px;
  text-align: center;
  font-size: small;
  color: #667864;
  border-top: 1px solid var(--line-strong);
}

/* ── Misc ───────────────────────────────────────────────── */
span.highlight { background-color: var(--accent-pale); }
