/* ============================================================
   Dr. Chunhua "Leo" Liao — Personal Academic Website
   style.css  |  Vanilla CSS, no framework
   Light, warm, uplifting redesign — v2
   ============================================================ */

/* ─── CSS CUSTOM PROPERTIES ─────────────────────────────── */
:root {
  /* ── Page backgrounds ── */
  --bg:          #f8fafc;       /* warm off-white page canvas        */
  --bg-warm:     #f0f7ff;       /* soft sky tint                     */
  --surface:     #ffffff;       /* pure white cards/panels           */
  --surface-mid: #e8f2ff;       /* soft blue — stat chips, hover bg  */
  --surface-alt: #ecfdf5;       /* mint green — hero ring inner      */

  /* ── Accent palette ── */
  --coral:       #3b82f6;       /* primary CTA, highlights (calm blue) */
  --coral-light: #60a5fa;       /* hover / ring glow                 */
  --coral-dark:  #2563eb;       /* pressed / dark text accent        */
  --gold:        #f59e0b;       /* secondary warm accent             */
  --gold-light:  #fcd34d;       /* soft golden highlight             */
  --teal:        #10b981;       /* links, secondary buttons (emerald)*/
  --teal-light:  #34d399;       /* teal hover                        */

  /* ── Text ── */
  --text-dark:   #1c1917;       /* headings, nav logo                */
  --text-body:   #44403c;       /* body paragraphs                   */
  --text-muted:  #78716c;       /* captions, subtitles               */
  --white:       #ffffff;

  /* ── Borders ── */
  --border:      #dde5ed;       /* default warm border               */
  --border-mid:  #c7d2dc;       /* slightly darker border            */

  /* ── Footer ── */
  --footer-bg:   #1e293b;       /* warm very-dark brown              */

  /* ── Spacing ── */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* ── Typography ── */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono:  'Fira Code', 'Consolas', monospace;

  /* ── Effects ── */
  --radius:    0.5rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 4px rgba(59,80,120,0.07), 0 1px 2px rgba(59,80,120,0.05);
  --shadow:    0 4px 20px rgba(59,80,120,0.11), 0 2px 8px rgba(59,80,120,0.07);
  --shadow-lg: 0 10px 40px rgba(59,80,120,0.14), 0 4px 14px rgba(59,80,120,0.08);
  --shadow-coral: 0 4px 18px rgba(59,130,246,0.25);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text-body);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--coral); }

a:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
  border-radius: 3px;
}

ul { list-style: none; }

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--text-dark);
}

/* ─── UTILITY ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  height: 3px;
  width: 3rem;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  border-radius: 2px;
  margin-top: 0.4rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

/* ── Section backgrounds ── */
.section-light {
  background: var(--surface);
  padding: var(--space-2xl) 0;
}

/* Research + Software — cool-to-warm gradient */
.section-dark {
  background: linear-gradient(150deg, #ecfdf5 0%, #f0fdf4 100%);
  padding: var(--space-2xl) 0;
  color: var(--text-body);
}

/* Contact — warm peach gradient */
.section-contact {
  background: linear-gradient(150deg, #eff6ff 0%, #dbeafe 100%);
  padding: var(--space-2xl) 0;
  color: var(--text-body);
}

.section-dark .section-title,
.section-contact .section-title  { color: var(--text-dark); }

.section-dark .section-subtitle,
.section-contact .section-subtitle { color: var(--text-muted); }

.section-dark .section-subtitle a,
.section-contact .section-subtitle a { color: var(--teal); }

.accent { color: var(--coral); }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

/* Primary: coral gradient — pops on any light bg */
.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--coral-light));
  color: var(--white);
  box-shadow: var(--shadow-coral);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--coral-dark), var(--coral));
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,246,0.40);
}

/* Secondary: white card with teal border → fills teal on hover */
.btn-secondary {
  background: var(--surface);
  color: var(--teal);
  border: 1.5px solid rgba(16,185,129,0.35);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.28);
}

/* Outline: coral border → fills coral on hover */
.btn-outline {
  background: transparent;
  color: var(--coral);
  border: 2px solid var(--coral);
  padding: 0.7rem 1.8rem;
}
.btn-outline:hover {
  background: var(--coral);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-coral);
}

/* Small chip: teal tinted */
.btn-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  background: rgba(16,185,129,0.09);
  color: var(--teal);
  border: 1px solid rgba(16,185,129,0.28);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}
.btn-sm:hover {
  background: var(--teal);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,185,129,0.28);
}

/* ─── NAVIGATION ─────────────────────────────────────────── */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(253, 250, 247, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

#site-header.scrolled {
  box-shadow: 0 2px 20px rgba(59,80,120,0.10);
}

.nav-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 64px;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.nav-logo:hover { color: var(--coral); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.25rem 0;
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  transform: scaleX(0);
  transition: transform var(--transition);
  border-radius: 1px;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text-dark); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* Hamburger toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  border-radius: 4px;
  transition: background var(--transition);
}
.nav-toggle:hover { background: var(--surface-mid); }
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── HERO SECTION ───────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(150deg, #f0f7ff 0%, #e8f2ff 55%, #dbeafe 100%);
  padding: calc(64px + var(--space-xl)) 0 var(--space-xl);
  overflow: hidden;
}

/* Warm-light bokeh orbs */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(59,130,246,0.09) 0%, transparent 52%),
    radial-gradient(ellipse at 80% 15%, rgba(245,158,11,0.07) 0%, transparent 45%),
    radial-gradient(ellipse at 65% 88%, rgba(16,185,129,0.06) 0%, transparent 40%);
  pointer-events: none;
}

/* Subtle warm dot-grid */
#hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(59,80,120,0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-bg-overlay { display: none; }

.hero-inner {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  position: relative;
  z-index: 1;
}

/* ─── HERO PHOTO ─────────────────────────────────────────── */
.hero-photo-wrap { flex-shrink: 0; }

.hero-photo {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-mid), var(--surface-alt));
  border: 4px solid rgba(59,130,246,0.32);
  box-shadow:
    0 0 0 8px rgba(59,130,246,0.07),
    0 20px 50px rgba(59,80,120,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 6s ease-in-out infinite;
  overflow: hidden;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.photo-initials {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 700;
  color: var(--coral);
  user-select: none;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

/* ─── HERO TEXT ──────────────────────────────────────────── */
.hero-text { flex: 1; min-width: 0; }

/* No-photo hero: center the text */
.hero-no-photo {
  justify-content: center;
  text-align: center;
}
.hero-no-photo .hero-text { max-width: 720px; }
.hero-no-photo .hero-now { text-align: left; display: inline-block; }
.hero-no-photo .hero-links { justify-content: center; }

.hero-label {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--coral-dark);
  background: rgba(59,130,246,0.09);
  border: 1px solid rgba(59,130,246,0.24);
  padding: 0.3rem 0.9rem;
  border-radius: 2rem;
  margin-bottom: var(--space-sm);
  animation: fadeUp 0.6s ease both;
}

.hero-text h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  animation: fadeUp 0.6s ease 0.1s both;
}

.hero-affiliation {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  animation: fadeUp 0.6s ease 0.2s both;
  line-height: 1.5;
}
.hero-affiliation strong { color: var(--text-dark); }

.hero-bio {
  color: var(--text-body);
  font-size: 1.05rem;
  max-width: 580px;
  margin-bottom: var(--space-md);
  line-height: 1.75;
  animation: fadeUp 0.6s ease 0.3s both;
}
.hero-bio strong { color: var(--coral-dark); font-weight: 600; }

/* Stat chips */
.hero-stats {
  display: flex;
  gap: 0.75rem;
  margin-bottom: var(--space-md);
  animation: fadeUp 0.6s ease 0.4s both;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.80);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 96px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.stat-num {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--coral);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  animation: fadeUp 0.6s ease 0.5s both;
}

/* ─── ABOUT / BACKGROUND SECTION ─────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.about-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

/* Coral-gold stripe slides in from left on hover */
.about-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
  border-radius: 2px 2px 0 0;
}

.about-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(59,130,246,0.25);
}
.about-card:hover::before { transform: scaleX(1); }

.about-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

.about-card h3 {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
}

.edu-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edu-list li {
  display: flex;
  flex-direction: column;
  font-size: 0.92rem;
}
.edu-list li strong {
  color: var(--text-dark);
  font-weight: 600;
}
.edu-list li span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  background: rgba(59,130,246,0.07);
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  border: 1px solid rgba(59,130,246,0.18);
  transition: background var(--transition);
}
.tag-list li:hover { background: rgba(59,130,246,0.14); }

/* ─── RESEARCH GRID ──────────────────────────────────────── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
}

.research-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

/* Teal stripe slides in on hover */
.research-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
  border-radius: 2px 2px 0 0;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(16,185,129,0.30);
}
.research-card:hover::before { transform: scaleX(1); }

.research-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.research-card h3 {
  color: var(--text-dark);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.research-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ─── PUBLICATIONS ───────────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pub-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

/* Coral-gold left stripe grows down on hover */
.pub-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--coral), var(--gold));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.pub-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(59,130,246,0.28);
}
.pub-item:hover::before { transform: scaleY(1); }

.pub-year {
  font-weight: 700;
  font-size: 1rem;
  color: var(--coral);
  padding-top: 0.25rem;
  padding-right: var(--space-sm);
  border-right: 2px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

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

.pub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
}

.badge-new   { background: #dcfce7; color: #166534; }
.badge-venue {
  background: rgba(16,185,129,0.09);
  color: var(--teal);
  border: 1px solid rgba(16,185,129,0.22);
}

.pub-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.3rem;
  line-height: 1.45;
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-style: italic;
}

.pub-desc {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.pub-links { display: flex; gap: 0.75rem; }

.pub-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition);
}
.pub-link:hover { color: var(--coral); }

.pub-more-wrap {
  text-align: center;
  margin-top: var(--space-lg);
}

/* ─── SOFTWARE CARDS ─────────────────────────────────────── */
.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.software-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.software-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(16,185,129,0.32);
}

/* Featured: golden-tinted banner card */
.software-card.featured {
  grid-column: span 2;
  border-color: rgba(245,158,11,0.40);
  background: linear-gradient(140deg, var(--surface) 60%, rgba(245,158,11,0.04) 100%);
  box-shadow: 0 4px 18px rgba(245,158,11,0.10);
}
.software-card.featured:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 30px rgba(245,158,11,0.18);
}

@media (max-width: 680px) {
  .software-card.featured { grid-column: span 1; }
}

.software-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.software-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.software-meta h3 {
  color: var(--text-dark);
  font-size: 1.1rem;
}

.sw-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.sw-tag.new {
  color: var(--coral, #3b82f6);
  font-weight: 700;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.15em 0.5em;
  border-radius: 4px;
}

.software-card p {
  color: var(--text-body);
  font-size: 0.92rem;
  line-height: 1.65;
  flex: 1;
}

/* R&D award highlight */
.software-card p em {
  color: var(--gold);
  font-style: normal;
  font-weight: 600; }

.software-links { display: flex; gap: 0.5rem; }

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

.sw-tags span {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 2rem;
  background: rgba(16,185,129,0.07);
  color: var(--teal);
  border: 1px solid rgba(16,185,129,0.15);
}

/* ─── CONTACT SECTION ────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.contact-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.contact-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
  border-radius: 2px 2px 0 0;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(59,130,246,0.28);
  color: inherit;
}
.contact-card:hover::before { transform: scaleX(1); }

.contact-icon { font-size: 2rem; }

.contact-card h3 { color: var(--text-dark); font-size: 1.05rem; }

.contact-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
}

.contact-link {
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition);
}
.contact-card:hover .contact-link { color: var(--coral); }

.contact-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.8;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--coral), var(--gold), var(--teal)) 1;
  padding: var(--space-lg) 0;
}

.footer-inner {
  text-align: center;
  color: rgba(255,255,255,0.50);
  font-size: 0.88rem;
  line-height: 1.8;
}

.footer-inner a { color: rgba(255,255,255,0.50); transition: color var(--transition); }
.footer-inner a:hover { color: var(--coral-light); }
.footer-sub { font-size: 0.8rem; opacity: 0.60; }

/* ─── SCROLL-REVEAL ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── KEYFRAMES ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-lg);
    padding-top: var(--space-md);
  }
  .hero-text h1 { font-size: 2.6rem; }
  .hero-bio { margin: 0 auto var(--space-md); }
  .hero-stats { justify-content: center; }
  .hero-links { justify-content: center; }
  .section-title::after { margin: 0.4rem auto 0; }
  .section-subtitle { margin-left: auto; margin-right: auto; text-align: center; }
  #about .section-title,
  #about .section-subtitle,
  #publications .section-title,
  #publications .section-subtitle { text-align: center; display: block; }
  #about .section-title::after,
  #publications .section-title::after { margin: 0.4rem auto 0; }
  .pub-more-wrap { text-align: center; }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --space-xl: 2.5rem;
    --space-2xl: 3.5rem;
  }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    z-index: 1005;
    background: rgba(253, 250, 247, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    gap: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem var(--space-md); font-size: 1rem; }

  .hero-photo { width: 220px; height: 220px; }
  .photo-initials { font-size: 3rem; }
  .hero-text h1 { font-size: 2rem; }
  .hero-stats { gap: var(--space-sm); flex-wrap: wrap; justify-content: center; }
  .stat-num { font-size: 1.3rem; }

  .pub-item {
    grid-template-columns: 50px 1fr;
    gap: 0.75rem;
    padding: var(--space-sm);
  }
  .pub-year {
    font-size: 0.85rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 0;
    border-right: none;
    border-bottom: 2px solid var(--border);
    justify-content: flex-start;
    align-items: center;
  }

  .research-grid  { grid-template-columns: 1fr; }
  .software-grid  { grid-template-columns: 1fr; }
  .contact-grid   { grid-template-columns: 1fr; }
  .about-grid     { grid-template-columns: 1fr; }

  .hero-links { flex-direction: column; align-items: center; }
  .btn { justify-content: center; }
}

/* ─── FOCUS / ACCESSIBILITY ──────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── SCROLLBAR (Webkit) ─────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-warm); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--coral-light); }

/* ─── SKIP LINK ──────────────────────────────────────────── */
.skip-link:focus {
  position: fixed;
  top: 0.5rem; left: 0.5rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--coral);
  color: var(--white);
  font-weight: 700;
  border-radius: var(--radius);
  clip: auto;
  width: auto; height: auto;
  overflow: visible;
  white-space: normal;
}

/* ─── RESEARCH PAGE STYLES ──────────────────────────────── */

/* Clickable research cards on index */
a.research-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.research-card-link .research-card {
  cursor: pointer;
}

a.research-card-link .research-card .learn-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--transition), transform var(--transition), color var(--transition);
}

a.research-card-link:hover .research-card .learn-more {
  opacity: 1;
  transform: translateX(0);
  color: var(--coral);
}

/* Research sub-page hero */
.research-page-hero {
  background: linear-gradient(150deg, #f0f7ff 0%, #e8f2ff 55%, #dbeafe 100%);
  padding: calc(64px + var(--space-xl)) 0 var(--space-xl);
  position: relative;
  overflow: hidden;
}

.research-page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(59,130,246,0.08) 0%, transparent 52%),
    radial-gradient(ellipse at 80% 15%, rgba(245,158,11,0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 65% 88%, rgba(16,185,129,0.05) 0%, transparent 40%);
  pointer-events: none;
}

.research-page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(59,80,120,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.research-page-hero .container { position: relative; z-index: 1; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  margin-bottom: var(--space-md);
  padding: 0.35rem 0.85rem;
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.back-link:hover {
  background: var(--teal);
  color: var(--white);
  transform: translateX(-3px);
}

.rp-label {
  display: inline-block;
  font-size: 0.80rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--coral-dark);
  background: rgba(59,130,246,0.09);
  border: 1px solid rgba(59,130,246,0.22);
  padding: 0.28rem 0.9rem;
  border-radius: 2rem;
  margin-bottom: var(--space-sm);
}

.rp-hero-icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-xs);
  display: inline-block;
}

.rp-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
}

.rp-desc {
  color: var(--text-body);
  font-size: 1.08rem;
  max-width: 680px;
  line-height: 1.75;
}

/* Section styles for research pages */
.rp-section { padding: var(--space-2xl) 0; }

.rp-section-light { background: var(--surface); }
.rp-section-warm  { background: linear-gradient(150deg, #ecfdf5 0%, #f0fdf4 100%); }
.rp-section-peach { background: linear-gradient(150deg, #eff6ff 0%, #dbeafe 100%); }

.rp-section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  color: var(--text-dark);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rp-section-title::after {
  content: none;
}

.rp-overview p {
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 840px;
  margin-bottom: var(--space-sm);
}

/* Publication list on research pages */
.rp-pub-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.rp-pub-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.rp-pub-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--coral), var(--gold));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--transition);
}

.rp-pub-item:hover::before { transform: scaleY(1); }

.rp-pub-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(59,130,246,0.28);
}

.rp-pub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.4rem;
}

.rp-pub-year {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--coral);
  background: rgba(59,130,246,0.09);
  padding: 0.15rem 0.55rem;
  border-radius: 2rem;
}

.rp-pub-venue {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(16,185,129,0.09);
  color: var(--teal);
  border: 1px solid rgba(16,185,129,0.20);
  padding: 0.15rem 0.55rem;
  border-radius: 2rem;
}

.rp-pub-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  line-height: 1.45;
}

.rp-pub-authors {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.4rem;
}

.rp-pub-desc {
  font-size: 0.92rem;
  color: var(--text-body);
  line-height: 1.65;
  margin-bottom: 0.55rem;
}

.rp-pub-links { display: flex; gap: 0.75rem; }

.rp-pub-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  transition: color var(--transition);
}
.rp-pub-link:hover { color: var(--coral); }
.rp-pub-link.is-disabled {
  color: var(--text-soft);
  cursor: default;
}

/* Software grid on research pages */
.rp-software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Impact section */
.rp-impact-box {
  background: linear-gradient(135deg, rgba(59,130,246,0.04) 0%, rgba(245,158,11,0.04) 50%, rgba(16,185,129,0.04) 100%);
  border: 1px solid rgba(59,130,246,0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.rp-impact-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--teal));
}

.rp-impact-box blockquote {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-dark);
  line-height: 1.65;
  margin-bottom: var(--space-sm);
  font-style: italic;
  padding-left: 1rem;
  border-left: 3px solid var(--coral);
}

.rp-impact-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: var(--space-sm);
}

.rp-impact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.96rem;
  color: var(--text-body);
  line-height: 1.65;
}

.rp-impact-list li::before {
  content: '→';
  color: var(--coral);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

/* ─── PRINT STYLES ──────────────────────────────────────── */
@media print {
  #site-header { position: static; }
  .research-page-hero { padding-top: var(--space-md); }
  body { color: #000; background: #fff; }
}

/* ─── NO-JS / REDUCED-MOTION FALLBACK ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .rp-hero-icon { animation: none; }
}

/* ================================================================
   BLOG STYLES — appended
   ================================================================ */

/* ── Blog Hero ─────────────────────────────────────────────────── */
.blog-hero {
  padding: calc(var(--space-2xl) + 64px) 0 var(--space-xl);
  background: linear-gradient(150deg, #f0f7ff 0%, #e8f2ff 50%, #ecfdf5 100%);
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.blog-hero-inner { max-width: 700px; margin: 0 auto; }
.blog-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--text-dark);
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}
.blog-hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Blog listing section ──────────────────────────────────────── */
.blog-listing-section { padding: var(--space-xl) 0 var(--space-2xl); }

/* ── Filter bar ────────────────────────────────────────────────── */
.blog-filter-bar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem 1.1rem;
  background: var(--surface);
  border: 1.5px solid var(--border-mid);
  border-radius: 99px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.filter-btn:hover { border-color: var(--coral); color: var(--coral); background: var(--surface-mid); }
.filter-btn.active {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--white);
  box-shadow: var(--shadow-coral);
}
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .25rem;
  background: rgba(255,255,255,.25);
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
}
.filter-btn:not(.active) .filter-count { background: rgba(0,0,0,.07); color: var(--text-muted); }

/* ── Post grid ─────────────────────────────────────────────────── */
.post-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media (min-width: 640px)  { .post-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3,1fr); } }

/* ── Post card ─────────────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.post-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--coral-light);
}
.post-card-link {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.post-card-link:hover { color: inherit; }
.post-card-meta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.post-date { font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.post-card-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: .6rem;
  font-weight: 700;
}
.post-card:hover .post-card-title { color: var(--coral-dark); }
.post-card-desc {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-read-more {
  font-size: .82rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: auto;
  padding-top: .5rem;
  transition: color var(--transition);
}
.post-card:hover .post-read-more { color: var(--coral); }

/* ── Category badges ───────────────────────────────────────────── */
.category-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.cat-tech     { background: #dbeafe; color: #1d6fa4; }
.cat-thoughts { background: #fef3c7; color: #92400e; }

/* ── Tag pills ─────────────────────────────────────────────────── */
.post-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.tag-pill {
  padding: .2rem .55rem;
  background: var(--surface-mid);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--text-muted);
}
.post-tags-large .tag-pill { font-size: .8rem; padding: .25rem .7rem; }
.no-posts-msg { color: var(--text-muted); font-size: 1rem; margin-top: var(--space-lg); }

/* ── Latest Posts section on index.html ────────────────────────── */
.section-blog { background: var(--bg-warm); padding: var(--space-2xl) 0; }
.latest-posts-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-md); }
@media (min-width: 640px) { .latest-posts-grid { grid-template-columns: repeat(3,1fr); } }

/* ── Post header ────────────────────────────────────────────────── */
.post-header-section {
  padding: calc(var(--space-xl) + 64px) 0 var(--space-lg);
  background: linear-gradient(150deg, #f0f7ff 0%, #e8f2ff 100%);
  border-bottom: 1px solid var(--border);
}
.post-header-inner { max-width: 760px; margin: 0 auto; }
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  margin-bottom: var(--space-md);
  transition: color var(--transition);
}
.back-to-blog:hover { color: var(--coral); }
.post-header-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}
.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: var(--space-sm);
}

/* ── Post content (reading view) ───────────────────────────────── */
.post-content-section { padding: var(--space-xl) 0 var(--space-2xl); background: var(--surface); }
.post-content-inner { max-width: 720px; margin: 0 auto; }

.post-body {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text-body);
}
.post-body h1, .post-body h2, .post-body h3,
.post-body h4, .post-body h5, .post-body h6 {
  font-family: var(--font-serif);
  color: var(--text-dark);
  margin: 2rem 0 .75rem;
  line-height: 1.3;
}
.post-body h1 { font-size: 1.9rem; }
.post-body h2 { font-size: 1.55rem; }
.post-body h3 { font-size: 1.25rem; }
.post-body h4 { font-size: 1.1rem; }
.post-body p  { margin-bottom: 1.35rem; }
.post-body ul, .post-body ol { padding-left: 1.75rem; margin-bottom: 1.25rem; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin-bottom: .4rem; }
.post-body a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.post-body a:hover { color: var(--coral); }
.post-body strong { font-weight: 700; color: var(--text-dark); }
.post-body em     { font-style: italic; }
.post-body del    { color: var(--text-muted); }
.post-body code {
  background: var(--surface-mid);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .15em .4em;
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--coral-dark);
}
.post-body pre {
  background: var(--footer-bg);
  color: #e8e0d8;
  border-radius: var(--radius);
  padding: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: .9rem;
  line-height: 1.6;
  max-width: 100%;
  word-break: normal;
  white-space: pre;
}

@media (max-width: 640px) {
  .post-body pre {
    font-size: .75rem;
    padding: var(--space-sm);
    border-radius: 8px;
    margin-left: -1rem;
    margin-right: -1rem;
    width: calc(100% + 2rem);
  }
}
.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.post-body blockquote {
  border-left: 3px solid var(--coral);
  padding-left: var(--space-md);
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}
.post-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.5rem auto;
  display: block;
  box-shadow: var(--shadow-sm);
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: .95rem;
}
.post-body th, .post-body td {
  padding: .6rem .9rem;
  border: 1px solid var(--border);
  text-align: left;
}
.post-body th {
  background: var(--surface-mid);
  font-weight: 700;
  color: var(--text-dark);
}

/* ── Post nav (prev/next) ──────────────────────────────────────── */
.post-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}
.post-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.post-nav-link {
  font-size: .875rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  max-width: 45%;
  transition: color var(--transition);
}
.post-nav-link:hover { color: var(--coral); }
.post-nav-link.prev { margin-right: auto; }
.post-nav-link.next { margin-left: auto; text-align: right; }
.post-back-wrap { margin-top: var(--space-md); }
.post-original-link {
  font-size: .875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.post-original-link a { color: var(--teal); }
.post-original-link a:hover { color: var(--coral); }

/* ── nav-active indicator ──────────────────────────────────────── */
.nav-links a.nav-active {
  color: var(--coral);
}
.nav-links a.nav-active::after {
  width: 100% !important;
  background: var(--coral) !important;
}

/* ─── CONVERSATIONAL HERO ──────────────────────────────── */
.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-style: italic;
  color: var(--coral, #3b82f6);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.hero-bio a {
  color: var(--coral, #3b82f6);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hero-bio a:hover { color: var(--coral-dark, #1d4ed8); }

.hero-now {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(59, 130, 246, 0.06);
  border-left: 4px solid var(--coral, #3b82f6);
  border-radius: 0 10px 10px 0;
}
.hero-now h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark, #1c1917);
  margin-bottom: 0.6rem;
}
.hero-now ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero-now li {
  position: relative;
  padding-left: 1.2em;
  margin-bottom: 0.4rem;
  color: var(--text-body, #44403c);
  font-size: 0.95rem;
  line-height: 1.5;
}
.hero-now li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--coral, #3b82f6);
  font-weight: bold;
}
.hero-now a {
  color: var(--coral, #3b82f6);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hero-now a:hover { color: var(--coral-dark, #1d4ed8); }

@media (max-width: 640px) {
  .hero-tagline { font-size: 1.1rem; }
  .hero-now { padding: 1rem; }
}

/* ─── ABOUT PROSE (blog-first layout) ─────────────────── */
.about-prose {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-body, #44403c);
}
.about-prose p { margin-bottom: 1.2rem; }
.about-prose a {
  color: var(--coral, #3b82f6);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.about-prose a:hover { color: var(--coral-dark, #1d4ed8); }

/* ─── WORK GRID (compact research + projects) ─────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.work-card {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.work-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}
.work-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
}
.work-card p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-body);
  margin: 0;
}
.featured-project {
  border-color: rgba(59,130,246,0.25);
}
.featured-project:hover {
  border-color: rgba(59,130,246,0.5);
}

.subsection-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--text-dark);
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(59,130,246,0.3);
}

@media (max-width: 640px) {
  .work-grid { grid-template-columns: 1fr; }
  .about-prose { font-size: 1rem; }
}

/* ===== Post Cover Images ===== */
.post-card-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
  margin: -1.2rem -1.4rem 1rem -1.4rem;
  width: calc(100% + 2.8rem);
}

.post-cover-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: var(--space-md);
}

/* ===== Topics Showcase (Homepage) ===== */
.topics-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.topic-showcase-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 1.2rem 1.4rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-showcase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
  border-color: var(--accent);
}

.topic-showcase-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.topic-showcase-card h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #1e293b;
}

.topic-showcase-card p {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0.2rem 0 0;
}

/* ===== Topics Page ===== */
.topic-section { padding: var(--space-xl) 0; }

.topic-header {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  margin-bottom: var(--space-lg);
}

.topic-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.topic-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.4rem 0;
  color: inherit;
}

.section-dark .topic-title { color: #1e293b; }

.topic-desc {
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.85;
  max-width: 680px;
  margin: 0;
}

.topic-posts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topic-post-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.topic-post-row:hover {
  background: rgba(59, 130, 246, 0.08);
}

.section-dark .topic-post-row:hover {
  background: rgba(59, 130, 246, 0.08);
}

.topic-post-row time {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 90px;
}

.topic-post-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: #1e293b;
}

.topic-post-row:hover .topic-post-title {
  color: var(--accent);
}

@media (max-width: 640px) {
  .topic-header { flex-direction: column; gap: var(--space-sm); }
  .topic-icon { font-size: 2rem; }
  .topic-title { font-size: 1.4rem; }
  .topic-post-row { flex-direction: column; gap: 0.25rem; padding: 0.6rem 0.75rem; }
  .topic-post-row time { min-width: auto; }
}
