/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --c-bg: #ffffff;
  --c-bg-alt: #f6f7f9;
  --c-surface: #ffffff;
  --c-text: #1a1a1a;
  --c-text-secondary: #4a4a4a;
  --c-text-muted: #7a7a7a;

  /* Dark blue — links & clickable text */
  --c-link: #1a4f8b;
  --c-link-hover: #2a6cb8;

  /* Teal — name, section titles, nav brand */
  --c-teal: #0d7377;
  --c-teal-light: #11959a;
  --c-teal-bg: #e4f4f4;

  /* Deep purple — year badges, buttons */
  --c-purple: #5b3a8c;
  --c-purple-light: #7a52b3;
  --c-purple-bg: #ede6f6;

  /* Warm rust — venue names, highlights */
  --c-rust: #b94a2e;
  --c-rust-bg: #fbeee8;

  /* Amber — news dates, accents */
  --c-amber: #a16207;
  --c-amber-bg: #fef3c7;

  /* General accent (teal by default) */
  --c-accent: var(--c-teal);
  --c-accent-light: var(--c-teal-light);
  --c-accent-bg: var(--c-teal-bg);

  --c-border: #dde2e8;
  --c-border-light: #e8ecf0;

  --max-w: 1060px;
  --nav-h: 60px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.7;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== TOP BAR ===== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border-light);
}

.top-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-brand {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 17px;
  color: var(--c-teal);
  text-decoration: none;
  margin-right: 8px;
}
.navbar-brand:hover { color: var(--c-teal-light); text-decoration: none; }
.social-icons a {
  color: var(--c-text-secondary);
  display: flex;
  align-items: center;
  transition: color 0.2s;
  text-decoration: none;
}
.social-icons a:hover { color: var(--c-accent); text-decoration: none; }
.social-icons a svg { width: 21px; height: 21px; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.navbar-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.navbar-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--c-text-secondary);
  letter-spacing: 0.01em;
  position: relative;
  padding-bottom: 2px;
  text-decoration: none;
}
.navbar-links a:hover { text-decoration: none; }
.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--c-accent);
  transition: width 0.25s ease;
}
.navbar-links a:hover { color: var(--c-text); }
.navbar-links a:hover::after,
.navbar-links a.active::after { width: 100%; }
.navbar-links a.active { color: var(--c-text); }

.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.menu-toggle svg { width: 22px; height: 22px; stroke: var(--c-text); }

@media (max-width: 640px) {
  .menu-toggle { display: block; }
  .social-icons { gap: 12px; }
  .social-icons a svg { width: 18px; height: 18px; }
  .navbar-links {
    display: none;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border-light);
    flex-direction: column;
    padding: 16px 32px;
    gap: 14px;
  }
  .navbar-links.open { display: flex; }
}

/* ===== MAIN ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}
.page-content { padding: 48px 0 80px; }

/* ===== HERO ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 60px;
  align-items: start;
  margin-bottom: 52px;
}

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { order: -1; justify-self: center; }
}

.hero-text h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--c-teal);
}
.hero-text .subtitle {
  font-size: 14.5px;
  color: var(--c-text-secondary);
  margin-bottom: 6px;
}
.hero-text .email-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 22px;
}
.hero-text .bio {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--c-text);
  text-align: justify;
}
.hero-text .bio p + p { margin-top: 14px; }

.hero-photo img {
  width: 230px;
  height: 230px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid var(--c-teal);
  box-shadow: 0 6px 28px rgba(13,115,119,0.12);
}

/* ===== NEWS ===== */
.section-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
  color: var(--c-teal);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--c-teal), transparent);
}

.news-list { list-style: none; }
.news-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 12px 0 12px 14px;
  border-bottom: 1px solid var(--c-border-light);
  border-left: 3px solid transparent;
  font-size: 14.5px;
  line-height: 1.65;
  transition: border-left-color 0.2s;
}
.news-item:hover {
  border-left-color: var(--c-teal);
  background: var(--c-bg-alt);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--c-amber);
  font-weight: 500;
  padding-top: 2px;
}
.news-content strong { font-weight: 600; color: var(--c-text); }

@media (max-width: 640px) {
  .news-item { grid-template-columns: 1fr; gap: 2px; }
}

/* ===== PUBLICATIONS ===== */
.pub-year {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 16px;
  padding: 4px 16px;
  background: var(--c-purple);
  color: #fff;
  border-radius: 4px;
  display: inline-block;
}
.pub-card {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--c-border-light);
  align-items: start;
}
.pub-card:last-child { border-bottom: none; }

.pub-thumb-wrap {
  width: 170px;
  height: 120px;
  border-radius: 6px;
  border: 1px solid var(--c-border-light);
  background: var(--c-bg-alt);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.pub-info {}

@media (max-width: 640px) {
  .pub-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pub-thumb-wrap {
    width: 100%;
    height: 180px;
  }
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  color: var(--c-link);
}
.pub-authors {
  font-size: 13.5px;
  color: var(--c-text-secondary);
  line-height: 1.5;
  margin-bottom: 4px;
}
.pub-authors .me {
  font-weight: 700;
  color: var(--c-text);
  text-decoration: underline;
  text-decoration-color: var(--c-teal);
  text-underline-offset: 2px;
}
.pub-venue {
  font-size: 13px;
  font-style: italic;
  color: var(--c-rust);
  font-weight: 500;
  margin-bottom: 10px;
}
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pub-links a,
.pub-links button {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  background: var(--c-purple-bg);
  border: 1px solid var(--c-purple);
  color: var(--c-purple);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.pub-links a:hover,
.pub-links button:hover {
  background: var(--c-purple);
  color: #fff;
  border-color: var(--c-purple);
  text-decoration: none;
}

/* Abstract toggle */
.pub-abstract {
  display: none;
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border-light);
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--c-text-secondary);
  text-align: justify;
}
.pub-abstract.open {
  display: block;
  animation: fadeUp 0.3s ease both;
}

/* WIP badge */
.wip-badge {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 4px;
  background: var(--c-rust-bg);
  color: var(--c-rust);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
}

/* ===== EXPERIENCE ===== */
.exp-card {
  padding: 20px 0;
  border-bottom: 1px solid var(--c-border-light);
}
.exp-card:last-child { border-bottom: none; }
.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.exp-role {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 600;
}
.exp-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--c-text-muted);
}
.exp-org {
  font-size: 14px;
  color: var(--c-teal);
  margin-bottom: 8px;
}
.exp-desc {
  font-size: 14px;
  color: var(--c-text-secondary);
  line-height: 1.7;
}
.exp-desc p + p { margin-top: 8px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--c-accent-bg);
  color: var(--c-accent);
}

/* ===== AWARDS ===== */
.awards-list { list-style: none; }
.award-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border-light);
  font-size: 14.5px;
  line-height: 1.6;
}
.award-item:last-child { border-bottom: none; }
.award-item .award-name { font-weight: 600; }
.award-item .award-org { color: var(--c-text-secondary); font-size: 13.5px; }

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--c-border);
  padding: 24px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--c-text-muted);
}
.footer a { color: var(--c-text-secondary); text-decoration: none; }
.footer a:hover { text-decoration: none; }

.visitor-counter-fixed {
  position: fixed;
  top: calc(var(--nav-h) + 10px);
  right: 16px;
  z-index: 90;
  padding: 4px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  line-height: 0;
}
.visitor-counter-fixed img {
  display: block;
  border-radius: 4px;
}
@media (max-width: 640px) {
  .visitor-counter-fixed {
    transform: scale(0.85);
    transform-origin: top right;
    top: calc(var(--nav-h) + 6px);
    right: 8px;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease both; }
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.2s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
