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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  background-color: #f9f7f4;
  color: #2d2d2d;
  -webkit-font-smoothing: antialiased;
  line-height: 1.75;
}

.layout { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid #e8e4df;
  background: #ffffff;
  padding: 2rem 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-inner { display: flex; flex-direction: column; height: 100%; }

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e8e4df;
}

.avatar-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e8e4df;
  margin-bottom: 0.5rem;
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 10%;
}

.name {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.2;
}

.role { font-size: 0.75rem; color: #3b82f6; font-weight: 400; }
.affiliation { font-size: 0.72rem; color: #9ca3af; }

.cv-button {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #1a1a1a;
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}
.cv-button:hover { background: #f3f4f6; border-color: #9ca3af; }

.nav { display: flex; flex-direction: column; gap: 0.05rem; margin-bottom: 1.5rem; }

.nav-link {
  font-size: 0.81rem;
  text-decoration: none;
  color: #9ca3af;
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease;
}

.nav-link::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.nav-link:hover { color: #374151; }
.nav-link.active { color: #1a1a1a; font-weight: 500; }
.nav-link.active::before { background: #3b82f6; }

.sidebar-meta {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid #e8e4df;
  font-size: 0.74rem;
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.email a { color: #6b7280; text-decoration: none; }
.email a:hover { color: #1a1a1a; }

.social { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.2rem; }

.social a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.73rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.social a:hover { color: #374151; border-bottom-color: #d1d5db; }

.sidebar-footer { margin-top: 1rem; font-size: 0.68rem; color: #d1d5db; }

/* ── Main ── */
.main {
  flex: 1;
  min-width: 0;
  padding: 3rem 4rem 4rem;
  background: #f9f7f4;
}

.section { margin-bottom: 3.5rem; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.section-title span:last-child {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #1a1a1a;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  margin-left: 0.6rem;
  background: #e8e4df;
}

.section-icon { font-size: 0.7rem; color: #3b82f6; flex-shrink: 0; }

.section-body { font-size: 0.93rem; color: #4b5563; line-height: 1.8; }
.section-body p + p { margin-top: 0.85rem; }
.section-body strong { color: #1f2937; font-weight: 500; }

.inline-link {
  color: #3b82f6;
  text-decoration: none;
  border-bottom: 1px solid rgba(59,130,246,0.3);
  transition: border-color 0.15s;
}
.inline-link:hover { border-bottom-color: #3b82f6; }

/* ── News ── */
.news-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }

.news-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0ede8;
}

.news-date {
  font-size: 0.75rem;
  color: #9ca3af;
  white-space: nowrap;
  min-width: 52px;
  font-variant-numeric: tabular-nums;
}

.news-text { font-size: 0.88rem; color: #4b5563; line-height: 1.6; }
.news-text strong { color: #1f2937; font-weight: 500; }
.news-text em { color: #6b7280; font-style: italic; }

/* ── Cards ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: #ffffff;
  border: 1px solid #e8e4df;
  border-radius: 0.5rem;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover { border-color: #c7d2fe; box-shadow: 0 2px 12px rgba(59,130,246,0.06); }
.card h3 { font-size: 0.88rem; font-weight: 500; color: #111827; margin-bottom: 0.5rem; }
.card p { font-size: 0.85rem; color: #6b7280; line-height: 1.7; }

.card-tagline {
  margin-top: 0.6rem;
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-links { margin-top: auto; padding-top: 0.75rem; }

.card-link {
  font-size: 0.78rem;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.15s;
}
.card-link:hover { opacity: 0.75; }

/* ── Publications ── */
.pub-list { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }

.pub-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: #ffffff;
  border: 1px solid #e8e4df;
  border-radius: 0.5rem;
  transition: border-color 0.2s ease;
}
.pub-item:hover { border-color: #c7d2fe; }

.pub-badge {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.45rem;
  border-radius: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-weight: 500;
}

.pub-badge.journal   { background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe; }
.pub-badge.conference { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.pub-badge.preprint  { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.pub-badge.wip       { background: #faf5ff; color: #6b21a8; border: 1px solid #e9d5ff; }

.pub-content { flex: 1; min-width: 0; }
.pub-title { font-size: 0.88rem; color: #111827; line-height: 1.5; margin-bottom: 0.2rem; }
.pub-meta { font-size: 0.77rem; color: #9ca3af; margin-bottom: 0.35rem; }
.pub-meta strong { color: #6b7280; font-weight: 500; }
.pub-cited { color: #3b82f6; font-weight: 500; }
.pub-links { display: flex; gap: 0.6rem; align-items: center; }

.pub-link {
  font-size: 0.75rem;
  color: #3b82f6;
  text-decoration: none;
  border-bottom: 1px solid rgba(59,130,246,0.25);
  transition: border-color 0.15s;
}
.pub-link:hover { border-bottom-color: #3b82f6; }
.pub-link-muted { font-size: 0.75rem; color: #d1d5db; font-style: italic; }

/* ── Skills ── */
.skills-grid { display: flex; flex-direction: column; gap: 1.1rem; }

.skill-group { display: flex; flex-direction: column; gap: 0.4rem; }

.skill-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  font-weight: 500;
}

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag {
  font-size: 0.78rem;
  color: #374151;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.3rem;
  padding: 0.2rem 0.55rem;
  transition: border-color 0.15s, color 0.15s;
}
.tag:hover { border-color: #93c5fd; color: #1d4ed8; }

/* ── Teaching ── */
.simple-list { list-style: none; margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }

.simple-list li {
  font-size: 0.88rem;
  color: #6b7280;
  padding-left: 1rem;
  position: relative;
  line-height: 1.6;
}
.simple-list li::before { content: '–'; position: absolute; left: 0; color: #d1d5db; }
.simple-list li strong { color: #374151; font-weight: 500; }

/* ── Contact ── */
.contact-line { font-size: 0.88rem; margin-top: 0.6rem; }
.contact-line strong { color: #374151; font-weight: 500; margin-right: 0.4rem; }
.contact-line a {
  color: #3b82f6;
  text-decoration: none;
  border-bottom: 1px solid rgba(59,130,246,0.25);
  transition: border-color 0.15s;
}
.contact-line a:hover { border-bottom-color: #3b82f6; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .layout { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    padding: 1.5rem 1.25rem 1rem;
    border-right: none;
    border-bottom: 1px solid #e8e4df;
  }

  .nav { flex-direction: row; flex-wrap: wrap; gap: 0.1rem 1rem; margin-bottom: 0.75rem; }
  .sidebar-meta { padding-top: 0.75rem; margin-top: 0; }
  .main { padding: 2rem 1.25rem 3rem; }
  .card-grid { grid-template-columns: 1fr; }
}
