/* ── Variables ─────────────────────────────────────────── */
:root {
  --accent:    #ae6b4a;
  --accent-lt: #faeee6;
  --text:      #28201a;
  --muted:     #7a6455;
  --border:    #e4d8cf;
  --bg:        #fdfaf7;
  --bg-alt:    #f5ede5;
  --radius:    14px;
  --max-w:     860px;
  --nav-h:     60px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Nav ───────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253,250,247,0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-name {
  font-family: 'Lora', Georgia, serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav-name:hover { text-decoration: none; color: var(--accent); }
.nav-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(40,32,26,0.12);
}
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.18s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

/* ── Nav dropdown ──────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after {
  content: ' ▾';
  font-size: 9px;
  opacity: 0.5;
  vertical-align: middle;
}
.nav-submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(40,32,26,0.1);
  padding: 5px;
  min-width: 130px;
  list-style: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 200;
}
.nav-submenu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: -8px;
  right: -8px;
  height: 12px;
}
.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
  opacity: 1;
  pointer-events: auto;
}
.nav-submenu li a {
  display: block;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.nav-submenu li a:hover,
.nav-submenu li a.active {
  background: var(--accent-lt);
  color: var(--accent);
  text-decoration: none;
}

/* ── Page wrapper ──────────────────────────────────────── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 52px 24px 88px;
}

/* ── Section heading ───────────────────────────────────── */
.section-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 24px;
}

/* ── About page ────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 44px;
  align-items: start;
}
.about-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 2px 12px rgba(40,32,26,0.08);
}
.about-photo-placeholder {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent-lt);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lora', Georgia, serif;
  font-size: 42px;
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(40,32,26,0.07);
}
.about-logo {
  width: 180px;
  height: 180px;
  border-radius: 32px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(40,32,26,0.13);
  display: block;
}
.about-name {
  font-family: 'Lora', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 3px;
}
.about-title {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 18px;
}
.about-bio { margin-bottom: 18px; color: var(--text); }
.about-bio p + p { margin-top: 12px; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  background: var(--bg);
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.social-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
  text-decoration: none;
}

/* ── CV download button ────────────────────────────────── */
.cv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  width: 100%;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s;
}
.cv-download-btn:hover {
  background: #92573a;
  border-color: #92573a;
  color: #fff;
  text-decoration: none;
}

/* ── Research interests tags ───────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.tag {
  background: var(--accent-lt);
  color: var(--accent);
  padding: 4px 13px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* ── Stats row ─────────────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 36px;
  margin: 28px 0 0;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.5px;
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Publications ──────────────────────────────────────── */
.pub-list { display: flex; flex-direction: column; gap: 16px; }
.pub-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(40,32,26,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pub-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(174,107,74,0.1);
}
.pub-venue {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pub-year {
  font-weight: 400;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
.pub-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.45;
}
.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); text-decoration: none; }
.pub-authors { font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.5; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pub-link {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  transition: border-color 0.18s, color 0.18s;
}
.pub-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.pub-link-bib {
  cursor: pointer;
  background: none;
  font-family: inherit;
}
.pub-link-bib.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-lt);
}
.pub-bibtex {
  display: none;
  margin-top: 12px;
  position: relative;
}
.pub-bibtex.open { display: block; }
.pub-bibtex pre {
  font-size: 11.5px;
  line-height: 1.65;
  padding: 12px 14px;
  padding-right: 56px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
  margin: 0;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.pub-bibtex-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
  font-family: inherit;
}
.pub-bibtex-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pub-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}
.badge-top  { background: #fef3d0; color: #8a6a00; }
.badge-press { background: #d8f0ec; color: #1a6b5e; }

/* ── Projects ──────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(40,32,26,0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(174,107,74,0.12);
  transform: translateY(-3px);
}
.project-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--accent-lt);
}
.project-img-placeholder {
  width: 100%;
  height: 160px;
  background: var(--accent-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.project-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.project-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.project-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text);
}
.project-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}
.project-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.project-link {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  transition: border-color 0.18s, color 0.18s;
}
.project-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ── News ──────────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 0; }
.news-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.news-item:first-child { border-top: 1px solid var(--border); }
.news-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.news-text { font-size: 14px; line-height: 1.6; }

/* ── Datasets ──────────────────────────────────────────── */
.dataset-list { display: flex; flex-direction: column; gap: 24px; }
.dataset-card {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(40,32,26,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dataset-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(174,107,74,0.1);
}
.dataset-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dataset-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.dataset-full-name {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.dataset-host {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.dataset-host-zenodo { background: #e8f0fc; color: #2a5aad; }
.dataset-host-hf     { background: #fef0e4; color: #c05c00; }
.dataset-desc {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 14px;
}
.dataset-meta { margin-bottom: 14px; }
.dataset-authors { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.dataset-authors strong { color: var(--text); font-weight: 600; }
.dataset-paper { font-size: 13px; color: var(--muted); }
.dataset-paper a { color: var(--accent); }
.dataset-links { display: flex; gap: 10px; flex-wrap: wrap; }
.dataset-link {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.18s, color 0.18s;
}
.dataset-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.dataset-link-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.dataset-link-primary:hover {
  background: #92573a;
  border-color: #92573a;
  color: #fff;
}

/* ── Service ───────────────────────────────────────────── */
.service-list { display: flex; flex-direction: column; gap: 20px; }
.service-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(40,32,26,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.service-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(174,107,74,0.08);
}
.service-card-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 2px;
}
.service-role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.3;
}
.service-year {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-top: 4px;
}
.service-event {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 3px;
}
.service-event a { color: var(--text); }
.service-event a:hover { color: var(--accent); text-decoration: none; }
.service-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.service-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 10px;
}
.service-desc strong { color: var(--text); }
.service-links { display: flex; gap: 8px; flex-wrap: wrap; }
.service-link {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  transition: border-color 0.18s, color 0.18s;
}
.service-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 600px) {
  .service-card { grid-template-columns: 1fr; gap: 8px; }
  .service-card-left { flex-direction: row; align-items: baseline; gap: 10px; }
}

/* ── Review list ───────────────────────────────────────── */
.review-list { display: flex; flex-direction: column; }
.review-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.review-item:first-child { border-top: 1px solid var(--border); }
.review-venue {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.review-full {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 720px) {
  .review-item { grid-template-columns: 1fr; gap: 2px; }
}

/* ── Press ──────────────────────────────────────────────── */
.press-featured {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.press-feature-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: 0 1px 4px rgba(40,32,26,0.04);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
}
.press-feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(174,107,74,0.1);
  transform: translateY(-2px);
  text-decoration: none;
}
.press-outlet {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}
.press-headline {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
}
.press-meta {
  font-size: 12px;
  color: var(--muted);
}
.press-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.press-list {
  display: flex;
  flex-direction: column;
}
.press-entry {
  display: grid;
  grid-template-columns: 200px 1fr 90px;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
  text-decoration: none;
  transition: background 0.15s;
}
.press-entry:first-child { border-top: 1px solid var(--border); }
.press-entry:hover { text-decoration: none; }
.press-entry:hover .press-entry-title { color: var(--accent); }
.press-entry-outlet {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.press-entry-title {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  transition: color 0.15s;
}
.press-entry-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .press-entry { grid-template-columns: 1fr; gap: 2px; }
  .press-entry-date { text-align: left; }
}

/* ── Footer ────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Hamburger button ──────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
  z-index: 400;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav overlay ────────────────────────────────── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(40,32,26,0.45);
  z-index: 290;
}
.nav-overlay.open { display: block; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: min(280px, 80vw);
    height: 100dvh;
    background: var(--bg);
    box-shadow: -6px 0 32px rgba(40,32,26,0.12);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 28px 40px;
    gap: 0;
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 300;
    overflow-y: auto;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links > li { width: 100%; }
  .nav-links > li > a {
    font-size: 16px;
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }
  .nav-links > li > a:hover,
  .nav-links > li > a.active { color: var(--accent); }

  /* Flatten dropdown into inline list */
  .nav-dropdown > a::after { display: none; }
  .nav-submenu {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 0 14px;
    min-width: unset;
    display: block;
    transition: none;
  }
  .nav-submenu::before { display: none; }
  .nav-submenu li a {
    font-size: 14px;
    padding: 9px 0;
    border-radius: 0;
    background: none;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    display: block;
  }
  .nav-submenu li a:hover,
  .nav-submenu li a.active { color: var(--accent); background: none; }

  /* Page layout */
  .about-grid { grid-template-columns: 1fr; }
  .about-photo, .about-photo-placeholder { margin: 0 auto; }
  .projects-grid { grid-template-columns: 1fr; }
  .news-item { grid-template-columns: 1fr; gap: 2px; }
  .service-card { grid-template-columns: 1fr; gap: 8px; }
  .service-card-left { flex-direction: row; align-items: baseline; gap: 10px; }
  .press-entry { grid-template-columns: 1fr; gap: 2px; }
  .press-entry-date { text-align: left; }
}
