/* ==============================================================================
   main.css — Academic Portfolio Styles
   To re-theme: change the CSS variables in :root below.
   ============================================================================== */

/* === Variables === */
:root {
  --bg:           #ffffff;
  --bg-alt:       #f8fafc;
  --bg-hover:     #f1f5f9;
  --text:         #0f172a;
  --text-muted:   #64748b;
  --accent:       #2563eb;
  --accent-dark:  #1d4ed8;
  --accent-light: #eff6ff;
  --border:       #e2e8f0;
  --radius:       6px;
  --max-width:    880px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }
p { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

/* === Navigation === */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}
.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 3.25rem;
  gap: 1rem;
}
.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.nav-brand:hover { color: var(--accent); text-decoration: none; }
.nav-links {
  display: flex;
  gap: 0.1rem;
  list-style: none;
  margin-left: auto;
}
.nav-links a {
  display: block;
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}
/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* === Main content === */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

/* === Hero section (home page) === */
.hero {
  text-align: center;
  padding: 2.75rem 0 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  margin: 0 auto 1.25rem;
  display: block;
}
.hero-photo-fallback {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 auto 1.25rem;
}
.hero-name {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}
.hero-affiliation {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}
.hero-links {
  justify-content: center;
}

/* === News feed (home page) === */
.news-feed {
  position: relative;
  padding-left: 1.75rem;
}
/* Vertical timeline line */
.news-feed::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 1px;
}
.news-entry {
  position: relative;
  padding-bottom: 1.5rem;
}
.news-entry:last-child { padding-bottom: 0; }
/* Timeline dot */
.news-entry::before {
  content: '';
  position: absolute;
  left: calc(-1.75rem + 1px);   /* aligns center of 12px dot with the 2px line */
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2.5px solid var(--accent);
  z-index: 1;
}
/* Most recent item: filled dot */
.news-entry:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.news-entry-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}
.news-entry-text {
  font-size: 0.975rem;
  line-height: 1.6;
  color: var(--text);
}

/* === About section bio === */
.about-bio {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--text);
}

/* === Profile section (home page) === */
.profile {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 2.25rem;
  align-items: start;
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.profile-photo {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.profile-photo-fallback {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.profile-info h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}
.affiliation {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}
.affiliation a { color: var(--text-muted); }
.affiliation a:hover { color: var(--accent); }
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.interest-tag {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid #bfdbfe;
  border-radius: 100px;
  padding: 0.15rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
}
.bio {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1.1rem;
  line-height: 1.7;
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}
.social-link i { font-size: 0.9rem; }

/* === Section headings === */
.section { margin-bottom: 3rem; }
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  letter-spacing: -0.01em;
}

/* === Page header (non-home pages) === */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p {
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

/* === News / Updates === */
.news-list { display: flex; flex-direction: column; }
.news-item {
  display: flex;
  gap: 1.25rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  align-items: baseline;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  min-width: 72px;
  font-variant-numeric: tabular-nums;
}

/* === Publications === */
.pub-year-group { margin-bottom: 1.75rem; }
.pub-year {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.pub-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; }
.pub-title {
  font-weight: 600;
  font-size: 0.975rem;
  line-height: 1.4;
  margin-bottom: 0.2rem;
  color: var(--text);
}
.pub-authors {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}
.pub-award {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 0.1rem 0.55rem;
  margin-bottom: 0.45rem;
}
/* Link badges */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.1rem;
}
.pub-link {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.01em;
  transition: filter 0.12s;
}
.pub-link:hover { filter: brightness(0.88); text-decoration: none; }
.pub-link-pdf     { background: #fee2e2; color: #991b1b; }
.pub-link-arxiv   { background: #fef3c7; color: #78350f; }
.pub-link-code    { background: #d1fae5; color: #065f46; }
.pub-link-slides  { background: #e0e7ff; color: #3730a3; }
.pub-link-poster  { background: #fce7f3; color: #9d174d; }
.pub-link-project { background: #ede9fe; color: #5b21b6; }
.pub-link-doi     { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }
/* Abstract toggle */
.pub-abstract { margin-top: 0.5rem; }
.pub-abstract details summary {
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
  transition: color 0.12s;
}
.pub-abstract details summary::-webkit-details-marker { display: none; }
.pub-abstract details summary::before { content: "▸ Abstract"; }
.pub-abstract details[open] summary::before { content: "▾ Abstract"; }
.pub-abstract details summary:hover { color: var(--accent); }
.pub-abstract .abstract-text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.65;
  background: var(--bg-alt);
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
}

/* === Talks === */
.talk-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.talk-item:last-child { border-bottom: none; }
.talk-title { font-weight: 600; font-size: 0.975rem; margin-bottom: 0.2rem; }
.talk-meta { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.talk-type-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: 0.05rem 0.45rem;
  border-radius: 3px;
  margin-right: 0.35rem;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* === CV page === */
.cv-download {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.5rem;
  transition: background 0.15s;
}
.cv-download:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }

.cv-section { margin-bottom: 2.25rem; }
.cv-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 1.1rem;
  display: inline-block;
  letter-spacing: -0.01em;
}
.cv-entry { margin-bottom: 1.25rem; }
.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.cv-entry-title { font-weight: 600; font-size: 0.95rem; }
.cv-entry-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cv-entry-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.cv-entry-desc {
  font-size: 0.875rem;
  margin-top: 0.3rem;
  color: var(--text);
}
.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.cv-skill {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.15rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 1.5rem;
}
.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  font-size: 0.83rem;
  color: var(--text-muted);
}
.footer-container a { color: var(--text-muted); }
.footer-container a:hover { color: var(--accent); }

/* === "View all" link === */
.view-all {
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* === Responsive === */
@media (max-width: 640px) {
  .profile {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .interest-tags, .social-links { justify-content: center; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 3.25rem;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem 1rem;
    gap: 0.1rem;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .cv-entry-header { flex-direction: column; gap: 0.05rem; }
  .main-content { padding: 1.5rem 1.25rem 4rem; }
}
