/* ============================================
   Variables
   ============================================ */
:root {
  --bg: #faf9f7;
  --text: #1c1c1c;
  --text-secondary: #333;
  --text-muted: #555;
  --accent: #2e5aac;
  --accent-hover: #1e3f7a;
  --accent-subtle: rgba(46, 90, 172, 0.045);
  --border: #ddd;
  --border-light: #eee;
  --red: #bb0000;
  --nav-bg: rgba(250, 249, 247, 0.88);
}

/* ============================================
   Base
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Accent stripe at top of page */
body::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--accent);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

::selection {
  background: var(--accent);
  color: white;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Navigation
   ============================================ */
nav {
  position: sticky;
  top: 3px;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
}

.nav-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
}

/* ============================================
   Layout
   ============================================ */
.container {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 60px;
}

.section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin-bottom: 22px;
  display: inline-block;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 24px;
  height: 2px;
  background: var(--accent);
}

/* ============================================
   About / Header
   ============================================ */
#about {
  padding: 56px 0 44px;
  animation: fadeIn 0.5s ease forwards;
  scroll-margin-top: 60px;
}

.header-content {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.header-text { flex: 1; }
.header-photo { flex-shrink: 0; }

.header-photo img {
  width: 155px;
  height: 155px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.header-photo img:hover {
  border-color: var(--accent);
  transform: scale(1.02);
}

h1 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 14px;
}

.bio {
  font-size: 16px;
  line-height: 1.78;
  color: var(--text);
}

.bio p { margin-bottom: 10px; }

.bio a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.bio a:hover { border-bottom-color: var(--accent); }

.contact-line {
  font-size: 15px;
  color: var(--text-secondary);
}

.contact-line a {
  color: var(--accent);
  text-decoration: none;
}

.header-links {
  display: flex;
  gap: 6px;
  margin-top: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
}

.header-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 12px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.header-links a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ============================================
   News
   ============================================ */
.news-item {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  font-size: 15.5px;
  line-height: 1.65;
}

.news-date {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 68px;
  padding-top: 3px;
}

.news-text a {
  color: var(--accent);
  text-decoration: none;
}

.news-text a:hover { text-decoration: underline; }

.oral, .award {
  color: var(--red);
  font-weight: 600;
}

.show-more-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: 6px 0;
  margin-top: 6px;
  transition: color 0.2s;
}

.show-more-btn:hover { color: var(--text); }

/* ============================================
   Publications
   ============================================ */
.pub {
  display: flex;
  gap: 28px;
  padding: 20px 16px;
  margin: 0 -16px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.pub + .pub {
  border-top: 1px solid var(--border);
}

.pub:hover {
  background: var(--accent-subtle);
  border-color: var(--border);
}

.pub:hover + .pub {
  border-top-color: transparent;
}

.pub-media {
  flex-shrink: 0;
  width: 230px;
}

.pub-media video,
.pub-media img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.pub-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #888);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pub-details { flex: 1; }

.pub-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 17.5px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 5px;
}

.pub-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.pub-title a:hover { color: var(--accent); }

.pub-authors {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 4px;
}

.pub-authors a {
  color: var(--text-secondary);
  text-decoration: none;
}

.pub-authors a:hover { color: var(--accent); }

.pub-authors .me {
  color: var(--accent);
  font-weight: 600;
}

.pub-venue {
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pub-links {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.pub-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 11px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.pub-links a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pub-abstract {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-style: italic;
}

/* ============================================
   Experience
   ============================================ */
.exp-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 24px;
}

.exp-grid::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.exp-item {
  display: flex;
  gap: 20px;
  padding: 14px 16px;
  margin-left: -8px;
  border-radius: 6px;
  position: relative;
  transition: background 0.2s ease;
}

.exp-item:hover { background: var(--accent-subtle); }

.exp-item::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 22px;
  width: 9px;
  height: 9px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
}

.exp-logo {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.exp-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.85;
}

.exp-logo img.logo-padded {
  max-width: 140%;
  max-height: 140%;
}

.exp-info { flex: 1; }

.exp-company {
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.exp-company a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.exp-company a:hover { color: var(--accent); }

.exp-role {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.exp-period {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.exp-detail {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-style: italic;
}

/* ============================================
   Services
   ============================================ */
.services p {
  font-size: 15.5px;
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.services strong {
  color: var(--text);
  font-weight: 600;
}

/* ============================================
   Footer
   ============================================ */
footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

footer a:hover { color: var(--text); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 12px 28px 16px;
    gap: 12px;
  }
  .nav-toggle { display: block; }

  #about { padding-top: 36px; }

  .header-content {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .header-photo img {
    width: 120px;
    height: 120px;
  }

  .header-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .pub {
    flex-direction: column;
    padding: 14px 10px;
    margin: 0 -10px 6px;
  }

  .pub-media {
    width: 100%;
    max-width: 300px;
  }

  .news-item {
    flex-direction: column;
    gap: 2px;
  }

  .news-date { width: auto; }

  .exp-item {
    gap: 14px;
    padding: 12px 10px;
  }

  .exp-logo {
    width: 36px;
    height: 36px;
  }
}
