:root {
  /* ===== Base ===== */
  --bg: #f8fafc;
  --card: #ffffff;

  --text: #0b1220;          /* near-black blue */
  --muted: #5b6478;         /* slate blue-gray */

  /* ===== Accent ===== */
  --accent: #1c3faa;        /* deep academic blue */
  --accent-2: #162c6b;      /* darker blue for gradients / hover */

  --border: rgba(11, 18, 32, 0.08);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);

  --max: 1024px;
  --r: 20px;

  /* ===== Typography ===== */
  --fs-0: 0.92rem;
  --fs-1: 1rem;
  --fs-2: 1.35rem;
  --fs-3: 2.05rem;

  --w-regular: 400;
  --w-medium: 520;
  --w-semibold: 650;
  --w-bold: 750;

  --lh-tight: 1.22;
  --lh-normal: 1.6;
  --lh-loose: 1.75;
  --measure: 72ch;

  --font-serif: ui-serif, "Charter", "Georgia", "Times New Roman", serif;

  /* ===== Typography Harmony Tokens ===== */
  --text-2: rgba(15, 23, 42, 0.88);
  --text-3: rgba(15, 23, 42, 0.72);
  --muted-2: rgba(100, 116, 139, 0.85);

  --fs-xs: 0.82rem;
  --fs-sm: 0.9rem;
  --fs-md: 1rem;
  --fs-lg: 1.15rem;
}

.icon-bicolor-soft {
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    rgba(28, 63, 170, 0.55) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


/* ===== Reset / Base ===== */
* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-1);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
}

/* ===== Links ===== */
a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .2s ease, color .2s ease;
}
a:hover {
  background-size: 100% 2px;
  color: var(--accent-2);
}

/* ===== Typography Harmony (global) ===== */
p{
  margin: 10px 0;
  max-width: var(--measure);
  color: var(--text-2);
}

strong{
  font-weight: var(--w-semibold);
  color: var(--text);
}

/* Helpers you use in HTML */
.small{
  font-size: var(--fs-sm);
  color: var(--muted);
  margin-top: 2px;
}
.muted{
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* Headings */
h1 {
  font-size: var(--fs-3);
  line-height: var(--lh-tight);
  font-weight: var(--w-bold);
  letter-spacing: -0.015em;
  margin: 0 0 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  font-size: 1.25rem;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: var(--w-semibold);
  letter-spacing: -0.01em;
  color: var(--text);
}

h2 i,
.news-title i,
.news-title-plain i,
.badge i {
  margin-right: 6px;
  font-size: 0.95em;
  vertical-align: -0.1em;
  color: var(--accent);
}

.inline-icon {
  height: 1.2em;
  width: auto;
  vertical-align: -0.25em;
  margin-left: 2px;
  display: inline-block;
}

/* ===== Page Wrapper ===== */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 18px 64px;
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 12px;
  z-index: 100;
  box-shadow: var(--shadow);
}
.nav .links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== BIO WIDE ===== */
.bio-wide {
  text-align: justify;
  -webkit-hyphens: auto;
  -moz-hyphens: auto;
  -ms-hyphens: auto;
  hyphens: auto;
}
.bio-wide p {
  max-width: 100%;
  margin-bottom: 16px;
}

/* ===== Badges ===== */
/* ===== Clean badge (no box) ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);

  padding: 0;              /* remove pill padding */
  border: none;            /* remove border */
  background: none;        /* remove background */
  border-radius: 0;

  text-decoration: none;
  background-image: none;

  transition: color 0.2s ease;
}

.badge i {
  color: var(--accent);
  font-size: 1rem;
}

/* Subtle hover — text emphasis, no box */
.badge:hover {
  color: var(--accent);
}

/* ===== GRID LAYOUT (Bento Box) ===== */
.module-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
}
.full-width { grid-column: 1 / -1; }
@media (max-width: 800px) {
  .module-grid { grid-template-columns: 1fr; }
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  border-color: rgba(30, 64, 175, .2);
  transform: translateY(-1px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

/* ===== Hero Section (Inside Card) ===== */
.hero-banner {
  display: grid; grid-template-columns: 120px 1fr;
  gap: 24px; align-items: center;
}
@media (max-width: 600px) { .hero-banner { grid-template-columns: 1fr; } }

.avatar img {
  width: 120px; height: 120px; border-radius: 18px;
  border: 1px solid var(--border); display: block; object-fit: cover;
}
.hero-sub { color: var(--muted); font-size: 18px; margin-bottom: 4px; }

/* Hero actions */
.hero-actions {
  display: flex;
  gap: 15px;
  margin-top: 18px;
}

/* ===== Icon Buttons (Hero) ===== */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  background-color: var(--card);
  color: var(--text);
  border: 1px solid var(--border);

  height: 60px;
  min-width: 60px;
  padding: 0 20px;
  border-radius: 50px;

  font-size: 2rem;
  box-shadow: var(--shadow);
  text-decoration: none;

  background-image: none;
  transition: all 0.3s ease;
}

.icon-btn span {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap; /* FIX: was invalid "wrap" */
  font-size: 1rem;
  font-weight: 600;
  margin-left: 0;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background-color: rgba(30, 64, 175, 0.08);
  color: var(--accent);
  border-color: rgba(30, 64, 175, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover span {
  max-width: 150px;
  opacity: 1;
  margin-left: 12px;
}

/* ===== NEWS SCROLL WRAPPER ===== */
.news-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* Top fade */
.news-wrapper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30px;
  background: linear-gradient(to bottom, var(--card) 0%, transparent 100%);
  pointer-events: none;
  z-index: 5;
}

/* Bottom fade */
.news-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent 0%, var(--card) 100%);
  pointer-events: none;
  z-index: 5;
  display: block;
}

/* News scroll */
.news-scroll {
  max-height: 300px;
  overflow-y: auto;
  flex-grow: 1;
  height: auto;

  scrollbar-width: none;
  -ms-overflow-style: none;

  padding: 10px 0px 30px;
}
.news-scroll::-webkit-scrollbar { display: none; }

/* Lists */
.news, .edu, .xp, .teach { list-style: none; padding: 0; margin: 0; }

.news-item {
  display: grid; grid-template-columns: 70px 1fr; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.news-item:last-child { border-bottom: none; padding-bottom: 30px; }

.news-date {
  font-size: var(--fs-xs);
  color: var(--muted);
  padding-top: 3px;
  font-weight: 500;
  font-feature-settings: "tnum";
}

.news-title { font-weight: 600; font-size: 0.95rem; }

/* ===== Education ===== */
.edu-item { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.edu-item:last-child { border-bottom: none; }
.edu-row { display: grid; grid-template-columns: 48px 1fr; gap: 16px; }
.edu-logo { width: 48px; height: 48px; object-fit: contain; }
.edu-top { display: flex; justify-content: space-between; align-items: baseline; }
.edu-top strong { display: block; font-size: 0.90rem; }
.edu-right { font-size: 12px; color: var(--muted); white-space: nowrap; font-feature-settings: "tnum"; }
.edu-sub { font-size: 0.9rem; color: rgba(15,23,42,.8); margin-top: 2px; }

/* ===== Reviewing List Styling ===== */
.review-list { list-style: none; padding: 0; margin: 0; }

.review-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.review-list li:last-child { border-bottom: none; }

.review-year {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 16px;
  white-space: nowrap;
  font-feature-settings: "tnum";
}

/* ===== Inner Grids (Experience / Teaching) ===== */
.inner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 700px) { .inner-grid { grid-template-columns: 1fr; } }

.xp-item { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.xp-item:last-child { border-bottom: none; }
.xp-top { display: flex; justify-content: space-between; align-items: baseline; }
.xp-time { font-size: 12px; color: var(--muted); font-feature-settings: "tnum"; }
.xp-sub {
  display: flex;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 4px;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}

/* ===== Teaching ===== */
.teach { list-style: none; padding: 0; margin: 0; }

.teach li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-bottom: 1px dashed var(--border);
}
.teach li:last-child { border-bottom: none; }

.teach-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}

.teach-role {
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--text);
}

.teach-time {
  font-size: 0.85rem;
  color: var(--muted);
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.teach-venue {
  font-size: 0.95rem;
  color: rgba(15, 23, 42, 0.9);
  margin-top: 1px;
  letter-spacing: -0.01em;
}

.teach .small {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* ===== Utilities ===== */
.mt-16 { margin-top: 16px; }

/* ================================
   Publications Module (clean, single)
   ================================ */

/* Publication footnote */
.pub-note{
  margin-top: 24px;
  font-size: var(--fs-xs);
  color: var(--muted);
  font-style: italic;
}

/* Year header */
.year-header{
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-2);
  margin: 24px 0 12px;
  opacity: 0.45;
}

/* Pub item */
.pub-item{
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pub-item:last-child{ border-bottom: none; }

/* Title */
.pub-title{
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Authors */
.pub-authors{
  font-size: var(--fs-sm);
  color: var(--text-2);
}

/* Meta */
.pub-meta{
  font-size: var(--fs-xs);
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  margin: 4px 0;
}
.pub-meta strong{
  color: var(--accent);
  font-weight: 650;
}

/* Actions row */
.pub-actions{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* Paper pill */
.pill-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 42px;
  width: 42px;
  padding: 0;
  gap: 0;

  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
  background-image: none;
  box-shadow: var(--shadow);

  overflow: hidden;
  white-space: nowrap;

  transition:
    width 0.25s ease,
    padding 0.25s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.pill-btn i{
  font-size: 1.15rem;
  line-height: 1;
}

.pill-btn span{
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;

  font-size: var(--fs-xs);
  font-weight: 650;
  margin-left: 0;

  transition:
    max-width 0.25s ease,
    opacity 0.18s ease,
    margin-left 0.25s ease;
}

.pill-btn:hover{
  width: 110px;
  justify-content: flex-start;
  padding: 0 12px;

  background-color: rgba(30, 64, 175, 0.08);
  border-color: rgba(30, 64, 175, 0.35);

  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.10);
}

.pill-btn:hover span{
  max-width: 90px;
  opacity: 1;
  margin-left: 10px;
}

.pill-btn:focus-visible{
  outline: 2px solid rgba(30, 64, 175, 0.35);
  outline-offset: 2px;
}

/* Abstract: summary inline; panel full width below */
.abstract-toggle{ display: contents; }

.abstract-toggle summary{ list-style: none; }
.abstract-toggle summary::-webkit-details-marker{ display: none; }

.abstract-toggle summary{
  display: inline-flex;
  align-items: center;
  gap: 8px;

  height: 42px;
  padding: 0 14px;
  border-radius: 999px;

  cursor: pointer;
  user-select: none;

  font-size: var(--fs-sm);
  font-weight: 650;
  color: var(--muted);

  transition: color 0.2s ease, background-color 0.2s ease;
}

.abstract-toggle summary:hover{
  color: var(--accent);
  background: rgba(30, 64, 175, 0.06);
}

.abstract-toggle summary::after{
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  opacity: 0.9;
}

.abstract-toggle[open] summary::after{ transform: rotate(-135deg); }

.abstract-toggle summary:focus-visible{
  outline: 2px solid rgba(30, 64, 175, 0.35);
  outline-offset: 2px;
}

/* Abstract panel */
.abstract-toggle p{
  display: block;
  width: 100%;
  max-width: none;

  margin: 10px 0 0;
  padding: 12px 14px;

  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--text-2);

  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;

  text-align: justify;
}

/* Optional: subtle open animation */
.abstract-toggle[open] p{
  animation: abstractIn 0.18s ease-out;
}
@keyframes abstractIn{
  from{ opacity: 0; transform: translateY(-4px); }
  to{ opacity: 1; transform: translateY(0); }
}
