/* ==========================================================================
   Academic Portfolio Theme — Soumik Sarker
   Inspired by standard academic portfolios (avijeetas.github.io, istiakshihab.github.io)
   ========================================================================== */

/* SECTIONS TEMPORARILY HIDDEN (code preserved, uncomment to restore):
   #skills, #awards sections are commented out per user request.
   To re-enable, remove the display:none rules below. */
#skills, #awards {
  display: none !important;
}

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* --- Color Variables & Design Tokens --- */
:root {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-subtle: #f8fafc;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-subtle: #eff6ff;
  --accent-border: #bfdbfe;
  
  --border: #e2e8f0;
  --border-focus: #94a3b8;
  
  --green: #15803d;
  --green-subtle: #dcfce7;
  --green-border: #86efac;
  
  --amber: #b45309;
  --amber-subtle: #fef3c7;
  
  --purple: #6d28d9;
  --purple-subtle: #ede9fe;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);

  --font-serif: 'EB Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-primary: #0a0f1d;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --bg-subtle: #172033;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-subtle: #082f49;
  --accent-border: #0369a1;
  
  --border: #1e293b;
  --border-focus: #334155;
  
  --green: #4ade80;
  --green-subtle: #052e16;
  --green-border: #166534;
  
  --amber: #fbbf24;
  --amber-subtle: #451a03;
  
  --purple: #a78bfa;
  --purple-subtle: #2e1065;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7), 0 4px 6px -4px rgba(0, 0, 0, 0.6);
}

/* --- Base Reset & Typography --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, .academic-heading {
  font-family: var(--font-serif);
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.85rem; letter-spacing: -0.01em; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* --- Top Navigation Bar --- */
.academic-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-brand-title .brand-accent {
  color: var(--accent);
}

.nav-brand-title .brand-primary {
  color: var(--text-primary);
}

/* --- Research Section --- */
.research-overview {
  margin-bottom: 1.5rem;
}

.research-areas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 700px) {
  .research-areas-grid {
    grid-template-columns: 1fr;
  }
}

.research-area-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-normal);
}

.research-area-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.research-area-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.research-area-body {
  flex: 1;
  min-width: 0;
}

.research-area-title {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.3rem 0;
  line-height: 1.3;
}

.research-area-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.research-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.research-note i {
  color: var(--accent);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.nav-menu-links {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.nav-menu-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.nav-menu-links a:hover,
.nav-menu-links a.active {
  color: var(--accent);
  background-color: var(--accent-subtle);
}

.nav-right-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-subtle);
}

.btn-nav-cv {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--accent);
  color: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.btn-nav-cv:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* --- Layout Grid --- */
.academic-page-wrapper {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.5rem;
}

.academic-main-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2.25rem;
  align-items: start;
}

/* --- Left Profile Sidebar --- */
.academic-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.profile-avatar-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 1.25rem;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--bg-surface);
  box-shadow: 0 0 0 2px var(--border), var(--shadow-md);
}

.profile-name {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.profile-tagline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.profile-affiliation {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: var(--green-subtle);
  color: var(--green);
  border: 1px solid var(--green-border);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background-color: var(--green);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.sidebar-social-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background-color: var(--accent-subtle);
  transform: translateY(-2px);
}

.sidebar-divider {
  height: 1px;
  background-color: var(--border);
  margin: 1.25rem 0;
  border: none;
}

.sidebar-meta-list {
  text-align: left;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--text-secondary);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.meta-item i {
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

.sidebar-info-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.interest-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.interest-pill {
  font-size: 0.78rem;
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* --- Right Main Content Styling --- */
.academic-main-content {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
  min-width: 0;
}

.content-section {
  position: relative;
}

.section-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.6rem;
  left: 0;
  width: 48px;
  height: 2px;
  background-color: var(--accent);
}

.section-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- About & Hero Section --- */
.hero-bio-lead {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.hero-bio-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.callout-banner {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-elevated) 100%);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.callout-banner-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-banner-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.callout-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-callout-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--accent);
  color: #fff !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.btn-callout-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-callout-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary) !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.btn-callout-secondary:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background-color: var(--accent-subtle);
}

/* Featured Media Cards */
.media-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.media-card-img-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  background-color: var(--bg-surface-elevated);
  overflow: hidden;
}

.media-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

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

.media-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.media-card:hover .media-play-overlay {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.1);
}

.media-card-body {
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.media-card-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.media-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.media-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0;
}

/* --- News / Updates Section --- */
.news-feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.news-item:hover {
  border-color: var(--accent-border);
  background-color: var(--accent-subtle);
}

.news-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  min-width: 95px;
}

.news-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  background-color: var(--accent);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  margin-right: 0.5rem;
}

.news-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* --- Publications Section --- */
.pub-filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.pub-filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pub-filter-btn:hover,
.pub-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pub-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-normal);
}

.pub-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.pub-header-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.pub-number-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-top: 0;
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0;
  padding-top: 0;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

.pub-author-highlight {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.pub-venue-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pub-venue-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background-color: var(--bg-surface-elevated);
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.pub-venue-name {
  font-style: italic;
  color: var(--text-primary);
}

.pub-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.pub-keyword-pill {
  font-size: 0.72rem;
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary) !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.pub-btn:hover,
.pub-btn.active {
  color: var(--accent) !important;
  border-color: var(--accent-border);
  background-color: var(--accent-subtle);
}

.pub-drawer {
  margin-top: 1rem;
  padding: 1rem;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

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

.pub-bibtex-block {
  position: relative;
}

.pub-bibtex-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: transparent;
  padding: 0;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.btn-copy-bibtex {
  position: absolute;
  top: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all var(--transition-fast);
}

.btn-copy-bibtex:hover {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pub-abstract-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* --- Timeline Layout (Experience & Education) --- */
.academic-timeline {
  position: relative;
  padding-left: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.academic-timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 7px;
  width: 2px;
  background-color: var(--border);
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg-primary);
  z-index: 1;
}

.timeline-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.timeline-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-role {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.timeline-date-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  background-color: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.timeline-org {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.timeline-org a {
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

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

.timeline-bullets {
  padding-left: 1.25rem;
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  line-height: 1.55;
}

.timeline-bullets li::marker {
  color: var(--accent);
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* --- Open Source Section --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.stat-box:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.os-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.os-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.os-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
  gap: 0.5rem;
}

.os-repo-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.os-repo-stars {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.os-badge-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.os-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.os-badge-merged {
  background-color: var(--green-subtle);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.os-badge-issue {
  background-color: var(--amber-subtle);
  color: var(--amber);
  border: 1px solid var(--amber);
}

.os-badge-review {
  background-color: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.os-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* --- Projects Section --- */
.project-filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.project-filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.project-filter-btn:hover,
.project-filter-btn.active-filter {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.academic-project-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.academic-project-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.proj-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.proj-category-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.badge-thesis { background-color: var(--purple-subtle); color: var(--purple); border: 1px solid var(--purple); }
.badge-ml { background-color: var(--accent-subtle); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-web { background-color: var(--amber-subtle); color: var(--amber); border: 1px solid var(--amber); }
.badge-tool { background-color: var(--green-subtle); color: var(--green); border: 1px solid var(--green-border); }

.proj-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.proj-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.proj-links {
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.proj-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none !important;
  transition: color var(--transition-fast);
}

.proj-link-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline !important;
}

/* Featured Project Layout */
.featured-proj-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  position: relative;
}

.featured-ribbon {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Skills Section --- */
.skills-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skill-category-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.skill-category-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-md);
}

.skill-cat-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-items-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.skill-badge i {
  color: var(--accent);
}

.skill-badge:hover {
  background-color: var(--accent-subtle);
  border-color: var(--accent-border);
}

/* --- Awards & Certifications --- */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.award-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.award-item:hover {
  border-color: var(--accent-border);
  transform: translateX(4px);
}

.award-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--amber-subtle);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.cert-icon-box {
  background-color: var(--accent-subtle);
  color: var(--accent);
}

.award-details {
  flex-grow: 1;
}

.award-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.award-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.award-year {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.award-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.45;
}

/* --- Compact Standard Academic Footer --- */
.academic-footer {
  border-top: 1px solid var(--border);
  background-color: var(--bg-surface);
  padding: 1.5rem 1.25rem;
  text-align: center;
  margin-top: 2rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.footer-copy {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin: 0;
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* --- Modal Base Styles (Fixing document flow overflow) --- */
.modal {
  position: fixed !important;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none;
  width: 100vw;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal.show {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 1.75rem auto;
  max-width: 800px;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: var(--bg-surface);
  background-clip: padding-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  outline: 0;
  box-shadow: var(--shadow-lg);
}

.modal-backdrop {
  display: none !important; /* Handled directly by modal container */
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Toast Alert for BibTeX copy */
.academic-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.academic-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
  .academic-main-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .academic-sidebar {
    position: static;
  }
  
  .profile-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    text-align: left;
    gap: 1.5rem;
    align-items: center;
  }
  
  .profile-avatar-wrapper {
    margin: 0;
  }
  
  .sidebar-social-links {
    justify-content: flex-start;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .skills-category-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-md);
  }
  
  .nav-menu-links.show {
    display: flex;
  }
  
  .mobile-nav-toggle {
    display: block;
  }
  
  .profile-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .profile-avatar-wrapper {
    margin: 0 auto 1.25rem;
  }
  
  .sidebar-social-links {
    justify-content: center;
  }
  
  .academic-page-wrapper {
    padding: 1.25rem 1rem 1.5rem;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
