@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Source+Serif+4:opsz,wght@8..60,400;600;700&display=swap');

:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --text-subtle: #8a8a8a;
  --border: #e4e4e4;
  --border-strong: #c8c8c8;
  --accent: #2d2d2d;
  --link: #1a1a1a;
  --link-hover: #555555;
  --max-width: 720px;
  --nav-width: 960px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--text-muted);
}

/* Navigation */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.site-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.site-name:hover {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 4px;
  list-style: none;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.site-nav a.active {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

/* Layout */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Home two-column layout */

.home-layout {
  max-width: var(--nav-width);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 56px;
  align-items: start;
}

.profile-col {
  position: sticky;
  top: 56px;
  align-self: start;
}

.profile-card {
  padding-top: 8px;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
  object-fit: cover;
  margin-bottom: 20px;
}

.profile-card h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.affiliation {
  font-size: 0.875rem;
  color: var(--text-subtle);
}

.content-col {
  min-width: 0;
}

/* Sections */

section {
  margin-bottom: 40px;
}

section:last-child {
  margin-bottom: 0;
}

section h2 {
  font-size: 1.2rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

section p.year-heading {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-subtle);
  margin: 4px 0 14px;
  letter-spacing: 0.04em;
}

section h2 + .year-heading {
  margin-top: 4px;
}

.year-heading + .other-list + .year-heading,
.card-link + .year-heading,
.other-list + .year-heading {
  margin-top: 28px;
}

section p {
  margin-bottom: 12px;
  color: var(--text);
}

section p:last-child {
  margin-bottom: 0;
}

/* Lists */

.clean-list {
  list-style: none;
}

.clean-list li {
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.clean-list li::before {
  content: "—";
  margin-right: 10px;
  color: var(--text-subtle);
}

.bullet-list {
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.bullet-list li {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

/* Links grid */

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.link-item {
  display: block;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.link-item:hover {
  border-color: var(--border-strong);
  background: #f5f5f5;
  color: var(--text);
  text-decoration: none;
}

/* Cards */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.card:last-child {
  margin-bottom: 0;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-top: 8px;
}

a.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

a.card-link:hover {
  color: inherit;
  text-decoration: none;
  border-color: var(--border-strong);
  background: #f5f5f5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

a.card-link h3::after {
  content: " ↗";
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* Compact clickable list for Other projects */

.other-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

a.other-item {
  display: block;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.other-item:hover {
  color: inherit;
  text-decoration: none;
  border-color: var(--border-strong);
  background: #f5f5f5;
}

a.other-item h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

a.other-item h3::after {
  content: " ↗";
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-subtle);
}

a.other-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Tags */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: #f0f0f0;
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
}

/* Publication entries */

.pub-entry {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.pub-entry:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.pub-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-style: italic;
}

.pub-links {
  margin-top: 8px;
  display: flex;
  gap: 14px;
}

.pub-links a {
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
}

.pub-links a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.sync-note {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin-bottom: 16px;
}

.sync-note a {
  font-weight: 500;
}

.section-footer {
  margin-top: 24px;
}

/* Placeholder */

.placeholder {
  padding: 32px 24px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-subtle);
  font-size: 0.9rem;
}

/* Page title (inner pages) */

.page-header {
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Contact line */

.contact-line {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-line a {
  font-weight: 500;
}

/* Footer */

.site-footer {
  max-width: var(--nav-width);
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
}

@media (max-width: 820px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .profile-col {
    position: static;
    top: auto;
    text-align: center;
  }

  .profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .avatar {
    margin-bottom: 16px;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
    gap: 2px;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 10px 12px;
  }

  .nav-inner {
    position: relative;
  }

  main {
    padding-top: 36px;
  }
}

/* Enhanced badges, CV timeline, and subtle highlights */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.cv-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px 24px;
  margin-bottom: 20px;
}

.cv-date {
  font-size: 0.85rem;
  color: var(--text-subtle);
  font-weight: 500;
  padding-top: 2px;
}

.cv-item h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.cv-item .cv-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cv-item p, .cv-item ul {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.skills-grid .card {
  margin-bottom: 0;
}

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