/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --bg:            #faf9f6;
  --bg-alt:        #f2f1ec;
  --text:          #1a1a1a;
  --text-muted:    #64748b;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --border:        #e2e8f0;
  --nav-bg:        rgba(255, 255, 255, 0.95);
  --tag-bg:        #f1f5f9;
  --tag-text:      #475569;
  --card-bg:       #ffffff;
  --card-shadow:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  --badge-bg:      #334155;
  --badge-text:    #ffffff;
  --icon-color:    #475569;
  --footer-bg:     #0f172a;
  --footer-text:   #94a3b8;
  --highlight:     #fef9c3;

  /* Backward compat */
  --global-bg-color:          var(--bg);
  --global-text-color:        var(--text);
  --global-theme-color:       var(--accent);
  --global-hover-color:       var(--accent-hover);
  --global-footer-bg-color:   var(--footer-bg);
  --global-footer-text-color: var(--footer-text);
  --global-footer-link-color: #e2e8f0;
  --global-icon-color:        var(--icon-color);
}

html[data-theme='dark'] {
  --bg:            #14151a;
  --bg-alt:        #1d1f26;
  --text:          #eceae4;
  --text-muted:    #94a3b8;
  --accent:        #60a5fa;
  --accent-hover:  #93c5fd;
  --border:        #334155;
  --nav-bg:        rgba(15, 23, 42, 0.95);
  --tag-bg:        #1e293b;
  --tag-text:      #94a3b8;
  --card-bg:       #1e293b;
  --card-shadow:   0 1px 3px rgba(0,0,0,0.3);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.5);
  --badge-bg:      #475569;
  --badge-text:    #ffffff;
  --icon-color:    #94a3b8;
  --footer-bg:     #020617;
  --footer-text:   #475569;
  --highlight:     #3b2f00;

  --global-bg-color:          var(--bg);
  --global-text-color:        var(--text);
  --global-theme-color:       var(--accent);
  --global-hover-color:       var(--accent-hover);
  --global-footer-bg-color:   var(--footer-bg);
  --global-footer-text-color: var(--footer-text);
  --global-footer-link-color: #cbd5e1;
  --global-icon-color:        var(--icon-color);
}

/* Dark mode icon visibility */
:root .fa-sun  { display: none; }
:root .fa-moon { display: inline-block; }
html[data-theme='dark'] .fa-sun  { display: inline-block; }
html[data-theme='dark'] .fa-moon { display: none; }

/* ============================================================
   GLOBAL
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  padding-top: 64px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 960px;
  padding-left: 2rem;
  padding-right: 2rem;
}

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

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

/* ============================================================
   NAVBAR
   ============================================================ */
#navbar {
  background-color: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 0.75rem 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.navbar-brand {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text) !important;
  letter-spacing: -0.02em;
}

.navbar-brand:hover {
  color: var(--accent) !important;
  text-decoration: none;
}

.navbar-nav .nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted) !important;
  padding: 0.4rem 0.75rem !important;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}

.navbar-nav .nav-link:hover {
  color: var(--accent) !important;
  background-color: var(--tag-bg);
  text-decoration: none;
}

.navbar-nav .nav-item.active .nav-link {
  color: var(--accent) !important;
  font-weight: 600;
}

/* Social icons in navbar */
.navbar .contact-icon {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 1.1rem;
}

.navbar .contact-icon a {
  color: var(--icon-color);
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
  display: inline-flex;
  align-items: center;
}

.navbar .contact-icon a:hover {
  color: var(--accent);
  background-color: var(--tag-bg);
  text-decoration: none;
}

/* Dark mode toggle button */
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

#theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--tag-bg);
}

/* Hamburger */
.navbar-toggler {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.navbar-toggler .icon-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-muted);
  border-radius: 1px;
  margin: 4px 0;
  transition: all 0.2s;
}

.navbar-toggler .top-bar    { transform: rotate(45deg) translate(4px, 4px); }
.navbar-toggler .middle-bar { opacity: 0; }
.navbar-toggler .bottom-bar { transform: rotate(-45deg) translate(4px, -4px); }
.navbar-toggler.collapsed .top-bar    { transform: rotate(0); }
.navbar-toggler.collapsed .middle-bar { opacity: 1; }
.navbar-toggler.collapsed .bottom-bar { transform: rotate(0); }

/* ============================================================
   HERO / PROFILE SECTION
   ============================================================ */
.hero-section {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  padding: 2.5rem 0 2rem;
}

/* ── Left sidebar: avatar + identity (sticky) ── */
.hero-sidebar {
  flex-shrink: 0;
  width: 200px;
  text-align: center;
  position: sticky;
  top: 1.5rem;
  align-self: flex-start;
}

.hero-avatar {
  width: 100%;
  border-radius: 50%;
  box-shadow: var(--card-shadow-hover);
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top;
  margin-bottom: 1rem;
  transform: rotate(6deg);
}

.hero-sidebar h1 {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 0.1rem;
  line-height: 1.2;
}

.hero-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

/* Affiliation list */
.hero-affil {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}

.hero-affil li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.12rem 0;
}

.hero-affil li a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--border);
}

.hero-affil li a:hover {
  color: var(--text);
  text-decoration-color: var(--text-muted);
}

/* Contact line */
.hero-contact {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  word-break: break-all;
}

.hero-contact i {
  font-size: 0.75rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* Social links — vertical list */
.hero-social {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hero-social a {
  color: var(--icon-color);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

.hero-social a:hover {
  color: var(--text);
  background-color: var(--bg-alt);
  border-color: var(--text-muted);
}

/* ── Right: bio + sections ── */
.hero-bio {
  flex: 1;
  min-width: 0;
  padding-top: 0.25rem;
}

.hero-bio > p {
  font-size: 0.97rem;
  color: var(--text);
  margin-bottom: 0.9rem;
  line-height: 1.72;
}

/* Bio links: no blue — underline highlight only */
.hero-bio > p a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

.hero-bio > p a:hover {
  color: var(--text);
  text-decoration-color: var(--text-muted);
}

/* Sections inside the right column */
.content-section {
  margin-top: 2.8rem;
  padding-top: 0.2rem;
}

/* ============================================================
   RESPONSIVE — Tablet (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  .hero-section {
    gap: 2rem;
  }
  .hero-sidebar {
    width: 170px;
  }
  .publications-header h1,
  .projects-header h1,
  .post-title {
    font-size: 1.6rem;
  }
  .content-section {
    margin-top: 2rem;
  }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 640px)
   ============================================================ */
@media (max-width: 640px) {
  /* Layout */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Navbar — center brand over profile photo on mobile */
  #navbar .container {
    position: relative;
    justify-content: flex-end;
  }
  .navbar-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    white-space: nowrap;
  }

  /* Hero */
  .hero-section {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding-top: 1.25rem;
  }
  .hero-sidebar {
    width: min(220px, 60vw);
    position: static;
    margin: 0 auto;
  }
  .hero-sidebar h1 {
    font-size: 1.3rem;
  }
  .hero-title {
    font-size: 0.9rem;
  }
  .hero-affil li {
    font-size: 0.88rem;
    padding: 0.2rem 0;
  }
  .hero-contact {
    font-size: 0.85rem;
  }
  .hero-social a {
    justify-content: center;
    padding: 0.55rem 0.75rem;  /* larger touch target */
    font-size: 0.88rem;
  }
  .hero-bio > p {
    font-size: 0.95rem;
  }

  /* Sections */
  .content-section {
    margin-top: 1.75rem;
  }
  .section-heading {
    font-size: 1rem;
  }

  /* News: stack date + text vertically */
  .news-item {
    flex-direction: column;
    gap: 0.35rem;
  }
  .news-date {
    align-self: flex-start;
    font-size: 0.78rem;
  }

  /* Publications */
  .publications-header h1,
  .projects-header h1,
  .post-title {
    font-size: 1.4rem;
  }
  .pub-venue {
    font-size: 0.75rem;
  }
  .pub-title {
    font-size: 0.95rem;
  }
  .pub-authors {
    font-size: 0.85rem;
  }
  .pub-links a {
    padding: 0.35rem 0.75rem;  /* larger touch target */
    font-size: 0.82rem;
  }

  /* Projects */
  .project-item {
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 1.5rem 0;
  }
  .project-thumb {
    width: 100%;
  }
  .project-thumb img {
    height: 180px;
  }
  .project-title {
    font-size: 1rem;
  }

  /* Footer */
  .site-footer {
    margin-top: 2.5rem;
    font-size: 0.82rem;
  }
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-heading::after {
  content: '';
  flex: 1;
}

/* ============================================================
   NEWS SECTION (legacy full-width — no longer used)
   ============================================================ */
.news-section {
  margin: 2rem 0;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-item {
  display: flex;
  gap: 1.1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  align-items: flex-start;
  line-height: 1.65;
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.15rem;
  letter-spacing: 0.02em;
  min-width: 48px;
  text-align: center;
}

.news-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background-color: var(--accent);
  color: white;
  letter-spacing: 0.03em;
  vertical-align: middle;
  margin-left: 0.35rem;
  white-space: nowrap;
}

.news-badge.green {
  background-color: #16a34a;
}

.news-badge.orange {
  background-color: #d97706;
}

/* ============================================================
   MEDIA SECTION
   ============================================================ */
.media-section {
  margin: 2rem 0;
}

.media-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.media-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.media-list li:last-child {
  border-bottom: none;
}

.media-list li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.55rem;
}

/* Service section pinpoint */
.service-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.55rem;
}

/* ============================================================
   PUBLICATIONS PAGE
   ============================================================ */
.publications-header {
  padding: 2rem 0 1rem;
}

.publications-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.publications-header .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pub-year-header {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pub-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s;
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-venue {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background-color: var(--badge-bg);
  color: var(--badge-text);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.pub-title {
  font-weight: 700;
  font-size: 0.97rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.pub-authors em {
  color: var(--text);
  font-style: normal;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.pub-authors a {
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
}

.pub-authors a:hover {
  color: var(--accent);
  text-decoration: none;
  border-bottom-style: solid;
  border-bottom-color: var(--accent);
}

.pub-venue-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.pub-links a {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  transition: all 0.15s;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
}

.pub-links a:hover,
.pub-links a.active {
  color: var(--accent);
  border-color: var(--accent);
  background-color: var(--tag-bg);
  text-decoration: none;
}

.pub-abstract {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  display: none;
}

.pub-abstract.open {
  display: block;
}

/* Legacy compat */
.publications { margin-top: 2rem; }
.publications h2.year { display: none; }
.publications ol.bibliography { list-style: none; padding: 0; }

/* ============================================================
   PROJECTS PAGE — Card Grid
   ============================================================ */
.projects-header {
  padding: 2rem 0 1.5rem;
}

.projects-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* Grid: 2 columns, featured card spans both */
.project-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

/* Base card */
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 14px 14px 0 0;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: transparent;
}

.project-card:hover::before {
  opacity: 1;
}

/* Featured card spans full width */
.project-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: stretch;
}

/* Cover image — full image visible, never cropped */
.project-card__cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
}

html[data-theme='dark'] .project-card__cover {
  background: #f1f5f9;
}

.project-card--featured .project-card__cover {
  width: 200px;
  aspect-ratio: unset;
  border-bottom: none;
  border-right: 1px solid var(--border);
}

.project-card__cover img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.35s ease;
  image-rendering: -webkit-optimize-contrast;
}

.project-card:hover .project-card__cover img {
  transform: scale(1.03);
}

/* Icon cover (for projects without a photo) */
.project-card__cover--icon {
  padding: 0;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

html[data-theme='dark'] .project-card__cover--icon {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--border) 100%);
}

.project-card__cover--icon i {
  font-size: 2.8rem;
  color: var(--accent);
  opacity: 0.7;
}

/* Card body */
.project-card__body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Meta: org + year */
.project-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}

.project-card__org {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.project-card__year {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.project-card__year::before {
  content: '·';
  margin-right: 0.5rem;
  color: var(--border);
}

/* Title */
.project-card__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.project-card--featured .project-card__title {
  font-size: 1.05rem;
}

.project-card__title a {
  color: var(--text);
  text-decoration: none;
}

.project-card__title a:hover {
  color: var(--accent);
}

/* Description */
.project-card__desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  flex: 1;
}

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

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

.project-card__desc a:hover {
  text-decoration: underline;
}

/* Tags */
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: auto;
}

.project-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Tablet: single column */
@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .project-card--featured {
    flex-direction: column;
  }
  .project-card--featured .project-card__cover {
    width: 100%;
    aspect-ratio: 16 / 7;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .project-grid {
    gap: 0.75rem;
  }
  .project-card__body {
    padding: 0.85rem;
  }
  .project-card__title {
    font-size: 0.88rem;
  }
  .project-card--featured .project-card__title {
    font-size: 0.95rem;
  }
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 1.5rem 0;
  margin-top: 4rem;
  font-size: 0.8rem;
  text-align: center;
}

.site-footer a {
  color: var(--global-footer-link-color);
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ============================================================
   UTILITIES & OVERRIDES
   ============================================================ */
hr.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

code { color: var(--accent); }

/* Transition for theme switch */
html.transition,
html.transition *,
html.transition *::before,
html.transition *::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Post title on publications/projects pages */
.post-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Social section standalone */
.social { text-align: center; }
.social .contact-icon { font-size: 2rem; }
.social .contact-icon a { color: var(--icon-color); }
.social .contact-icon a:hover { color: var(--accent); }

/* Pagination */
.pagination .page-item.active .page-link {
  background-color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   SKILLS SECTION
   ============================================================ */
.skills-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.skills-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

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

.skill-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ============================================================
   AVAILABILITY BANNER
   ============================================================ */
.availability-banner {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem !important;
}

.availability-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

/* ============================================================
   FOCUS — THREE PILLARS
   ============================================================ */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.pillar {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: var(--card-bg);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pillar:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: transparent;
}

.pillar-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

html[data-theme='dark'] .pillar-icon {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--border) 100%);
}

.pillar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.pillar p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* ============================================================
   IMPACT — STAT GRID
   ============================================================ */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.impact-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--bg-alt);
}

.impact-num {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.1;
}

.impact-num span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 0.1rem;
}

.impact-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 0.3rem;
}

/* Responsive: pillars & impact stack on small screens */
@media (max-width: 640px) {
  .pillars {
    grid-template-columns: 1fr;
  }
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .impact-num {
    font-size: 1.4rem;
  }
}

/* ============================================================
   PILLAR EXAMPLE CHIPS
   ============================================================ */
.pillar-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.7rem;
}

.pillar-examples span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.12rem 0.45rem;
  white-space: nowrap;
}

/* ============================================================
   EXPERIENCE TIMELINE
   ============================================================ */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-item {
  display: flex;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-when {
  flex-shrink: 0;
  width: 118px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.timeline-role {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.timeline-org {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.timeline-org a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
}

.timeline-org a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .timeline-item {
    flex-direction: column;
    gap: 0.15rem;
  }
  .timeline-when {
    width: auto;
  }
}

/* ============================================================
   MINIMAL HOMEPAGE (single column)
   ============================================================ */
.container--narrow {
  max-width: 960px;
}

.intro {
  padding: 2.5rem 0 0.5rem;
}

.intro-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  display: block;
  margin-bottom: 1.1rem;
  box-shadow: var(--card-shadow);
}

.intro-name {
  font-size: 1.9rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 0.15rem;
}

.intro-tagline {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}

.intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  margin: 0;
  font-size: 0.88rem;
}

.intro-links a {
  color: var(--accent);
  text-decoration: none;
  position: relative;
}

.intro-links a:not(:last-child)::after {
  content: '·';
  color: var(--border);
  position: absolute;
  right: -0.55rem;
}

.intro-links a:hover {
  text-decoration: underline;
}

/* Prose bio */
.prose {
  padding: 1.5rem 0 0.5rem;
}

.prose p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 1rem;
}

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

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

/* Content blocks */
.block {
  margin-top: 2.5rem;
}

.block-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Link list (selected work, media) */
.linklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.linklist li {
  padding: 0.5rem 0;
  line-height: 1.5;
}

.linklist li a {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.linklist li a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.linklist li span {
  display: block;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.block-more {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
}

.block-more a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.block-more a:hover {
  text-decoration: underline;
}

/* Experience / news compact list */
.explist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.explist li {
  display: flex;
  gap: 0.9rem;
  padding: 0.4rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

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

.explist li a:hover {
  text-decoration: underline;
}

.exp-when {
  flex-shrink: 0;
  width: 96px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .explist li {
    flex-direction: column;
    gap: 0.1rem;
  }
  .exp-when {
    width: auto;
  }
}

/* ============================================================
   MINIMAL HOMEPAGE — richer typography & highlights (overrides)
   ============================================================ */
.intro-name    { font-size: 2.3rem; }
.intro-tagline { font-size: 1.15rem; color: var(--accent); font-weight: 700; }
.intro-links   { font-size: 0.92rem; }

.prose p {
  font-size: 1.075rem;
  line-height: 1.8;
}

/* Section titles: more presence + accent marker */
.block-title {
  font-size: 0.82rem;
  color: var(--text);
  border-bottom: none;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.block-title::before {
  content: '';
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Highlights band — key numbers */
.highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 1.75rem 0 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.highlights .hl b {
  display: block;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1.1;
}

.highlights .hl b small {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.highlights .hl span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.2rem;
}

/* Selected work: bigger titles, accent metrics */
.linklist li a { font-size: 1.08rem; }
.linklist li span { font-size: 0.9rem; }
.linklist li span b {
  color: var(--accent);
  font-weight: 700;
}

/* Experience/news: a touch bigger */
.explist li { font-size: 1rem; }

@media (max-width: 560px) {
  .highlights {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem 0.6rem;
  }
  .intro-name { font-size: 2rem; }
}

/* ============================================================
   MINIMAL HOMEPAGE — editorial type & proportions (overrides)
   ============================================================ */
.intro {
  padding-top: 3rem;
}

.intro-name {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: 2.9rem;
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 0.25rem;
}

.intro-tagline {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.45rem;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

/* Roomier reading rhythm */
.prose p {
  font-size: 1.08rem;
  line-height: 1.85;
}

.block { margin-top: 3rem; }

.block-title {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.linklist li { padding: 0.6rem 0; }
.linklist li a { font-size: 1.1rem; font-weight: 700; }

.explist li { padding: 0.5rem 0; }

/* Bigger highlight numbers with the serif for character */
.highlights .hl b {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 2rem;
}

@media (max-width: 560px) {
  .intro-name { font-size: 2.4rem; }
  .intro-tagline { font-size: 1.25rem; }
}

/* ============================================================
   EDITORIAL SERIF DIRECTION (thomwolf-like type, saxon lists)
   Final overrides — highest precedence.
   ============================================================ */
:root{ --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }

/* Keep chrome & small UI chips in a crisp sans */
.navbar-brand,
.navbar-nav .nav-link,
.project-tag, .skill-tag,
.pub-venue, .news-badge,
.block-title, .exp-when,
.intro-links,
.highlights .hl span,
.linklist li span,
.project-card__org, .project-card__year { font-family: var(--sans); }

.navbar-brand { font-weight: 800; letter-spacing: -0.03em; }

/* Homepage headings in Georgia (already the body serif) */
.intro-name{
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  font-weight: 600;
  font-size: 3.3rem;
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.intro-tagline{
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--accent);
}
.highlights .hl b{
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: 1.95rem;
}

/* Prose: editorial reading rhythm */
.prose p{ font-size: 1.18rem; line-height: 1.8; }
.prose{ max-width: 72ch; }

/* Section labels: uppercase sans, clearly legible */
.block-title{
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
}
.block-title::before{ width: 26px; height: 3px; }

/* Selected work: editorial hairline rules between rows */
.linklist li{
  border-top: 1px solid var(--border);
  padding: 0.7rem 0;
}
.linklist li:first-child{ border-top: none; }
.linklist li a{ font-family: Georgia, serif; font-weight: 600; font-size: 1.2rem; }
.linklist li span{ font-size: 0.92rem; }

/* Experience / News — saxon.me year-left rows */
.explist li{
  border-top: 1px solid var(--border);
  padding: 0.7rem 0;
  align-items: baseline;
  font-size: 1.1rem;
}
.explist li:first-child{ border-top: none; }
.exp-when{
  width: 104px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ============================================================
   CROSS-TAB CONSISTENCY — flat editorial surfaces on warm ground
   ============================================================ */
/* Homepage photo: soft ring instead of hard shadow, sits on warm bg */
.intro-photo {
  box-shadow: none;
  border: 1px solid var(--border);
  padding: 3px;
  background: var(--bg-alt);
}

/* Project cards: flat, hairline-bordered panels (no stark white, no heavy shadow) */
.project-card {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
}
.project-card::before { display: none; }
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: none;
  background: var(--bg-alt);
  border-color: var(--text-muted);
}

/* Card cover: warm neutral ground instead of pure white */
.project-card__cover,
html[data-theme='dark'] .project-card__cover {
  background: var(--bg-alt);
}
.project-card__cover--icon,
html[data-theme='dark'] .project-card__cover--icon {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--border) 100%);
}
.project-card__cover--icon i { color: var(--accent); opacity: 0.55; }

/* Serif titles on cards to match the editorial homepage */
.project-card__title,
.project-card__title a { font-family: Georgia, 'Iowan Old Style', serif; }

/* Publications: soften the heavy dark venue badge into an outline chip */
.pub-venue {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  font-family: var(--sans);
}
.pub-title { font-family: Georgia, 'Iowan Old Style', serif; font-size: 1.05rem; }

/* Section headings across inner pages: serif, consistent with homepage */
.publications-header h1,
.projects-header h1,
.post-title { font-family: Georgia, 'Iowan Old Style', serif; font-weight: 600; }

/* ============================================================
   INTRO HEADER — photo beside identity (final)
   ============================================================ */
.intro { padding: 1.5rem 0 0.5rem; }

.intro-head {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-bottom: 1.1rem;
}
.intro-id { min-width: 0; }

.intro-photo {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  flex-shrink: 0;
  margin: 0;
  padding: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  box-shadow: none;
}
.intro-name { margin: 0 0 0.25rem; }
.intro-tagline { margin: 0; }

@media (max-width: 560px) {
  .intro-head { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .intro-photo { width: 96px; height: 96px; }
}

/* ============================================================
   STANDARDIZE INNER PAGES (Projects / Publications) to homepage system
   ============================================================ */
/* Page titles — one size, serif, consistent with homepage scale */
.projects-header,
.publications-header { padding: 1.6rem 0 1.25rem; }

.projects-header h1,
.publications-header h1,
.post-title {
  font-family: Georgia, 'Iowan Old Style', serif;
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Section labels (publication year dividers) match .block-title */
.pub-year-header {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
}

/* Item titles — consistent serif sizing */
.pub-title { font-size: 1.15rem; line-height: 1.4; }
.project-card__title,
.project-card__title a { font-size: 1.06rem; line-height: 1.35; }

/* Body / metadata — consistent readable sizes */
.project-card__desc { font-size: 0.92rem; line-height: 1.6; }
.pub-authors { font-size: 0.92rem; }
.pub-venue-text { font-size: 0.9rem; }
.publications-header .subtitle { font-size: 0.95rem; }

/* Metadata & chips stay sans for crispness */
.pub-authors, .pub-venue-text,
.project-card__desc,
.projects-header p,
.publications-header .subtitle { font-family: var(--sans); }

/* ============================================================
   UNIFIED TYPE SCALE — single source of truth for all pages
   (appended last → overrides earlier ad-hoc sizes)
   ============================================================ */
:root{
  --fs-h1:    2.4rem;    /* page titles */
  --fs-title: 1.15rem;   /* item titles: papers, project cards, selected work */
  --fs-body:  1.05rem;   /* primary body & descriptions */
  --fs-meta:  0.92rem;   /* secondary metadata */
  --fs-label: 0.95rem;   /* section / year labels */
  --fs-chip:  0.78rem;   /* tags, badges, small chips */
}

/* Page titles */
.projects-header h1,
.publications-header h1,
.post-title{ font-size: var(--fs-h1); }

/* Item titles */
.linklist li a,
.pub-title,
.project-card__title,
.project-card__title a{ font-size: var(--fs-title); line-height: 1.4; }

/* Primary body & descriptions */
.prose p{ font-size: 1.12rem; }
.explist li,
.project-card__desc,
.pub-authors,
.pub-abstract{ font-size: var(--fs-body); }

/* Secondary metadata */
.linklist li span,
.pub-venue-text,
.publications-header .subtitle,
.projects-header p{ font-size: var(--fs-meta); }

/* Section & year labels */
.block-title,
.pub-year-header{ font-size: var(--fs-label); }

/* Small chips */
.project-tag,
.pub-venue,
.pub-links a,
.project-card__org,
.project-card__year,
.exp-when{ font-size: var(--fs-chip); }

/* ============================================================
   INTRO — photo on the right (name/tagline left)
   ============================================================ */
.intro-head { justify-content: space-between; }
.intro-id   { flex: 1; order: 1; }
.intro-photo{ order: 2; }

@media (max-width: 560px) {
  .intro-head { flex-direction: column; align-items: flex-start; }
  .intro-photo { order: -1; }   /* photo on top on mobile */
}

/* ============================================================
   INTRO — larger photo, lower placement for balance (final)
   ============================================================ */
.intro { padding-top: 2.75rem; }
.intro-photo { width: 150px; height: 150px; }

@media (max-width: 560px) {
  .intro { padding-top: 1.75rem; }
  .intro-photo { width: 120px; height: 120px; }
}

/* ============================================================
   EXPERIENCE / NEWS — clean two-column grid alignment (final)
   ============================================================ */
.explist { display: block; }

.explist li {
  display: grid;
  grid-template-columns: 132px 1fr;
  column-gap: 1.25rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
  font-size: var(--fs-body);
  line-height: 1.5;
}
.explist li:first-child { border-top: none; }

.exp-when {
  width: auto;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .explist li {
    grid-template-columns: 1fr;
    row-gap: 0.15rem;
    padding: 0.6rem 0;
  }
}

/* ============================================================
   INTRO LINKS — icon row (final)
   ============================================================ */
.intro-links {
  gap: 0.65rem;
  align-items: center;
}
.intro-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--icon-color);
  font-size: 1.05rem;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.intro-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-alt);
  text-decoration: none;
}
/* Remove the old text-link middle-dot separators */
.intro-links a:not(:last-child)::after { content: none; }

/* ============================================================
   NAVBAR BRAND — smaller, and hidden on the homepage (no duplicate name)
   ============================================================ */
.navbar-brand { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.home .navbar-brand { display: none; }

/* Project card — "My role" line */
.project-card__role {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.7rem;
}
.project-card__role .role-k {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--text);
  margin-right: 0.35rem;
}

/* ============================================================
   EXPERIENCE / NEWS — single flowing line (year inline) — FINAL
   ============================================================ */
.explist li {
  display: block;
  grid-template-columns: none;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
  font-size: var(--fs-body);
  line-height: 1.6;
}
.explist li:first-child { border-top: none; }

.exp-when {
  display: inline;
  width: auto;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.55rem;
  white-space: nowrap;
}

/* ============================================================
   NEWS — highlighted item (e.g. paper acceptance)
   ============================================================ */
.explist li.news-hot {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-top: none;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  margin: 0.3rem 0;
  font-weight: 600;
}
html[data-theme='dark'] .explist li.news-hot {
  background: rgba(96, 165, 250, 0.14);
}
.explist li.news-hot .exp-when { color: var(--accent); }
.explist li.news-hot strong { color: var(--accent); }
/* keep the row after a highlighted one from doubling its top border */
.explist li.news-hot + li { border-top: none; }

/* ============================================================
   HOMEPAGE SECTION PANELS + COLLAPSIBLE (details/summary)
   ============================================================ */
/* Colored panels for News & Selected Work */
.block--panel {
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--border);
  margin-top: 2rem;
}
.block--panel-news {
  background: linear-gradient(135deg, #eef4ff 0%, #e6efff 100%);
  border-color: #dbe6fb;
}
.block--panel-work {
  background: var(--bg-alt);
}
html[data-theme='dark'] .block--panel-news {
  background: rgba(96, 165, 250, 0.10);
  border-color: rgba(96, 165, 250, 0.25);
}

/* News highlighted item blends into the panel now */
.explist li.news-hot {
  background: transparent;
  border-top: none;
  padding: 0.55rem 0;
  margin: 0;
}
.explist li.news-hot + li { border-top: 1px solid var(--border); }

/* Collapsible sections (Experience, Media) */
details.block--fold { margin-top: 2rem; }
details.block--fold > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  user-select: none;
}
details.block--fold > summary::-webkit-details-marker { display: none; }
/* chevron via the accent bar already on .block-title::before stays; add arrow at end */
details.block--fold > summary::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  margin-left: auto;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
details.block--fold[open] > summary::after { transform: rotate(-135deg); }
details.block--fold > summary:hover::after { border-color: var(--accent); }
details.block--fold > ul { margin-top: 0.9rem; }

/* ============================================================
   PUBLICATIONS — cover thumbnail (book chapters)
   ============================================================ */
.pub-item--cover {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}
.pub-item--cover .pub-main { flex: 1; min-width: 0; }
.pub-cover {
  flex-shrink: 0;
  width: 150px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  background: #fff;
}
@media (max-width: 560px) {
  .pub-cover { width: 108px; }
  .pub-item--cover { gap: 0.8rem; }
}

/* Publication figure thumbnail (papers) — wider than a book cover */
.pub-cover--fig {
  width: 150px;
  border-radius: 6px;
  object-fit: contain;
}
@media (max-width: 560px) {
  .pub-cover--fig { width: 108px; }
}

/* ============================================================
   PUBLICATIONS — clickable image zoom (lightbox)
   ============================================================ */
.pub-cover {
  cursor: zoom-in;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.pub-cover:hover {
  transform: scale(1.04);
  box-shadow: var(--card-shadow-hover);
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2.5vmin;
  background: rgba(10, 12, 18, 0.88);
  cursor: zoom-out;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  background: #fff;
}
