/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */
:root {
  /* Colors - Clean academic palette */
  --primary-color: #1a5276;
  --primary-light: #2980b9;
  --primary-lighter: #ebf5fb;
  --secondary-color: #6b7280;
  --dark-color: #1c2833;
  --light-gray: #f7f9fb;
  --white: #ffffff;
  --text-color: #2c3e50;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;

  /* Accent colors - muted, professional */
  --accent-teal: #148f77;
  --accent-slate: #566573;
  --accent-warm: #b9770e;

  /* Typography */
  --font-body: 'Raleway', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Montserrat', 'Dosis', sans-serif;
  --font-mono: 'Roboto Mono', monospace;

  /* Spacing */
  --border-radius: 6px;
  --border-radius-lg: 10px;
  --container-width: 1200px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* Shadows - subtle and professional */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--spacing-sm);
  color: var(--dark-color);
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.4rem;
}

h4 {
  font-size: 1.2rem;
}

h5 {
  font-size: 1.05rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: var(--spacing-sm);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition-base);
}

a:hover {
  color: var(--primary-color);
}

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

/* ===========================
   CONTAINER & LAYOUT
   =========================== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-xl) 0;
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
  margin: var(--spacing-sm) auto 0;
  border-radius: 2px;
}

/* ===========================
   NAVIGATION
   =========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.nav-logo img {
  height: 50px;
  width: auto;
}

.nav-logo-short {
  display: none;
}

.nav-logo-full {
  display: block;
}

.nav-logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-color);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  list-style: none;
}

.nav-menu a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--spacing-xs) 0;
  position: relative;
  transition: var(--transition-base);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition-base);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a:hover {
  color: var(--primary-color);
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: var(--spacing-xs) 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition-base);
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: var(--spacing-xs) var(--spacing-md);
  color: var(--text-color);
  transition: var(--transition-fast);
}

.nav-dropdown-menu a:hover {
  background: var(--light-gray);
  color: var(--primary-color);
}

.nav-dropdown-menu a::after {
  display: none;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--dark-color);
  border-radius: 2px;
  transition: var(--transition-base);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  transform: translateX(100%);
  transition: var(--transition-base);
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.mobile-menu a:hover {
  background: var(--light-gray);
  color: var(--primary-color);
}

.mobile-dropdown-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.mobile-dropdown-menu {
  display: none;
  background: var(--light-gray);
}

.mobile-dropdown-menu.active {
  display: block;
}

.mobile-dropdown-menu a {
  padding-left: calc(var(--spacing-md) * 2);
}

/* ===========================
   HERO SECTION
   =========================== */
.hero {
  min-height: calc(100vh - 70px);
  margin-top: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('https://images.unsplash.com/photo-1657896090619-ab849b26d6bc?q=80&w=1332&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D') center center / cover no-repeat;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  color: var(--white);
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: var(--spacing-xl) var(--spacing-md);
}

.hero-title {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  color: var(--white);
  font-weight: 700;
  letter-spacing: -0.5px;
  animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.85;
  font-weight: 400;
  animation: fadeInUp 0.8s ease 0.2s backwards;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.4s backwards;
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--white);
}

.hero-stat-label {
  font-size: 0.9rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease 0.6s backwards;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  border-radius: var(--border-radius);
  transition: var(--transition-base);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-light);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--primary-color);
  border-color: var(--white);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--dark-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active,
.btn-secondary:active,
.btn-outline:active {
  transform: translateY(0);
}

/* Button outline on light background */
.card .btn-outline,
.content-section .btn-outline {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: transparent;
}

.card .btn-outline:hover,
.content-section .btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

/* ===========================
   CARDS
   =========================== */
.card {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--spacing-lg);
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  align-self: stretch;
}

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

.card-header {
  margin-bottom: var(--spacing-md);
  text-align: center;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: var(--spacing-sm);
}

.card-title a {
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition-fast);
}

/* Specific hover colors for different types of cards */
#news-container .card-title a:hover,
#home-news-grid .card-title a:hover {
  color: var(--primary-light);
}

.talk-card .card-title a:hover {
  color: var(--primary-color);
}

/* Talk Metadata Responsive Styling */
@media (max-width: 576px) {
  .talk-meta {
    flex-direction: column !important;
    white-space: normal !important;
    gap: 0.5rem !important;
  }

  .talk-meta span[style*="margin: 0 1rem"],
  .talk-meta span[style*="margin: 0 1.5rem"] {
    display: none !important;
  }
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-body {
  flex-grow: 1;
  color: var(--text-color);
}

.card-footer {
  margin-top: auto;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: center;
}

.card-footer .btn {
  flex: 0 1 auto;
  min-width: 180px;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.badge:hover {
  opacity: 0.85;
}

/* Tag Badge - used on blog cards, talk cards, and tag pages */
.tag-badge {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.3rem 0.75rem;
  border-radius: var(--border-radius);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.tag-badge:hover {
  background: var(--primary-light);
  color: var(--white);
  opacity: 1;
  transform: translateY(-1px);
}

/* Card Variants - Clean solid colors */
.card-primary {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.card-primary .card-title,
.card-primary .card-body,
.card-primary .card-body p {
  color: var(--white);
}

.card-accent-1 {
  border-left: 4px solid var(--primary-color);
}

.card-accent-2 {
  border-left: 4px solid var(--accent-teal);
}

.card-accent-3 {
  border-left: 4px solid var(--accent-warm);
}

.card-accent-4 {
  border-left: 4px solid var(--accent-slate);
}

/* Legacy gradient classes - mapped to clean accents */
.card-gradient-1 {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.card-gradient-1 .card-title,
.card-gradient-1 .card-body,
.card-gradient-1 .card-body p {
  color: var(--white);
}

.card-gradient-2 {
  background: var(--accent-teal);
  color: var(--white);
  border-color: var(--accent-teal);
}

.card-gradient-2 .card-title,
.card-gradient-2 .card-body,
.card-gradient-2 .card-body p {
  color: var(--white);
}

.card-gradient-3 {
  background: var(--accent-warm);
  color: var(--white);
  border-color: var(--accent-warm);
}

.card-gradient-3 .card-title,
.card-gradient-3 .card-body,
.card-gradient-3 .card-body p {
  color: var(--white);
}

.card-gradient-4 {
  background: var(--accent-slate);
  color: var(--white);
  border-color: var(--accent-slate);
}

.card-gradient-4 .card-title,
.card-gradient-4 .card-body,
.card-gradient-4 .card-body p {
  color: var(--white);
}

/* ===========================
   GRID LAYOUTS
   =========================== */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-lg);
  justify-content: center;
  align-items: stretch;
}

.grid>* {
  flex: 0 0 calc(33.333% - var(--spacing-lg));
  max-width: 400px;
  min-width: 300px;
  display: flex;
}

.grid-2 {
  /* 3 items per row on large screens */
}

.grid-2>* {
  flex: 0 0 calc(33.333% - var(--spacing-lg));
  max-width: 450px;
  min-width: 320px;
  display: flex;
}

.grid-3 {
  /* 3 column grid */
}

.grid-3>* {
  flex: 0 0 calc(33.333% - var(--spacing-lg));
  max-width: 400px;
  min-width: 300px;
  display: flex;
}

.grid-4 {
  /* 4 column grid */
}

.grid-4>* {
  flex: 0 0 calc(25% - var(--spacing-lg));
  max-width: 350px;
  min-width: 250px;
  display: flex;
}

/* Two Column Layout */
.two-column {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--spacing-xl);
  align-items: start;
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
  .grid-2>* {
    flex: 0 0 calc(50% - var(--spacing-lg));
    max-width: 500px;
  }
}

@media (max-width: 992px) {
  .grid>* {
    flex: 0 0 calc(50% - var(--spacing-lg));
    max-width: 100%;
  }

  .grid-2>*,
  .grid-3>* {
    flex: 0 0 calc(50% - var(--spacing-lg));
    max-width: 100%;
  }

  .grid-4>* {
    flex: 0 0 calc(33.333% - var(--spacing-lg));
    max-width: 100%;
  }
}

/* ===========================
   CONTENT SECTIONS
   =========================== */
.content-section {
  background: var(--white);
  padding: var(--spacing-xl) 0;
}

.content-section:nth-child(even) {
  background: var(--light-gray);
}

.content-section h2,
.content-section h3 {
  text-align: center;
}

.profile-image {
  width: 100%;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-md);
}

.info-card {
  background: var(--white);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin-bottom: var(--spacing-md);
}

.info-card h3 {
  font-size: 1.15rem;
  margin-bottom: var(--spacing-sm);
  color: var(--primary-color);
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card li {
  padding: var(--spacing-xs) 0;
  border-bottom: 1px solid var(--border-color);
}

.info-card li:last-child {
  border-bottom: none;
}

/* ===========================
   FILTER CONTROLS
   =========================== */
.filter-controls {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--text-color);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: var(--primary-lighter);
}

.filter-btn.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

/* Research Tags */
.research-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.tag-research {
  background: var(--primary-lighter);
  color: var(--primary-color);
}

.tag-software {
  background: #f0fdf4;
  color: var(--accent-teal);
}

/* Research Items */
.research-item {
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.research-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.research-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--light-gray);
}

.research-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.research-item:hover .research-image img {
  transform: scale(1.03);
}

.research-content {
  padding: var(--spacing-md);
}

.research-content h3 {
  font-size: 1.2rem;
  margin-bottom: var(--spacing-sm);
  color: var(--text-color);
}

.research-tags {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.research-links {
  display: flex;
  gap: var(--spacing-xs);
  margin-left: auto;
}

.research-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--light-gray);
  color: var(--text-color);
  transition: all 0.3s ease;
  font-size: 1rem;
}

.research-link:hover {
  background: var(--primary-color);
  color: var(--white);
}

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: var(--dark-color);
  color: var(--white);
  padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: var(--spacing-md);
  font-size: 1.05rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  display: block;
  margin-bottom: var(--spacing-xs);
}

.footer-section a:hover {
  color: var(--white);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition-base);
  color: inherit;
}

.social-links a:hover {
  background: var(--white);
  color: var(--primary-color);
  transform: translateY(-2px);
}

.social-links a i {
  transition: var(--transition-base);
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 992px) {
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .profile-image {
    display: block;
    margin-left: auto;
    margin-right: auto;
  }

  .info-card {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .social-links {
    justify-content: center;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.85rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .hero {
    min-height: auto;
    padding: var(--spacing-xl) 0;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .hero-stats {
    gap: var(--spacing-md);
  }

  .hero-stat-number {
    font-size: 1.85rem;
  }

  .nav-container {
    height: 60px;
  }

  .nav-logo img {
    height: 40px;
  }

  .nav-logo-full {
    display: none;
  }

  .nav-logo-short {
    display: block;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  /* Single column on mobile */
  .grid>*,
  .grid-2>*,
  .grid-3>*,
  .grid-4>* {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 100%;
  }

  /* Hide talk card separator on mobile */
  .talk-meta-separator {
    display: none;
  }

  /* Make profile image responsive on mobile */
  .profile-image {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.65rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-stat-number {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
  }

  /* Even smaller profile image for very small screens */
  .profile-image {
    max-width: 150px;
  }
}

/* ===========================
   UTILITY CLASSES
   =========================== */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: var(--spacing-xs);
}

.mt-2 {
  margin-top: var(--spacing-sm);
}

.mt-3 {
  margin-top: var(--spacing-md);
}

.mt-4 {
  margin-top: var(--spacing-lg);
}

.mt-5 {
  margin-top: var(--spacing-xl);
}

.mb-1 {
  margin-bottom: var(--spacing-xs);
}

.mb-2 {
  margin-bottom: var(--spacing-sm);
}

.mb-3 {
  margin-bottom: var(--spacing-md);
}

.mb-4 {
  margin-bottom: var(--spacing-lg);
}

.mb-5 {
  margin-bottom: var(--spacing-xl);
}

.hidden {
  display: none;
}

.visible {
  display: block;
}

/* ===========================
   DYNAMIC CONTENT STYLES
   =========================== */

/* Loading Spinner */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
  font-size: 1rem;
}

.publications-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  gap: var(--spacing-md);
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Research Tags (dynamic) */
.research-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.tag-research {
  background: var(--primary-lighter);
  color: var(--primary-color);
}

.tag-software {
  background: #f0fdf4;
  color: var(--accent-teal);
}

/* News Categories */
.news-category {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: var(--spacing-sm);
  padding: 0.2rem 0.5rem;
  background: var(--light-gray);
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Publications */
.publications-year-group {
  margin-bottom: var(--spacing-xl);
}

.year-heading {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  border-bottom: 2px solid var(--border-color);
}

.publication-title {
  font-size: 1.1rem;
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
}

.publication-title a {
  color: var(--dark-color);
  text-decoration: none;
  transition: var(--transition-base);
}

.publication-title a:hover {
  color: var(--primary-light);
}

.publication-authors {
  color: var(--text-color);
  margin-bottom: var(--spacing-xs);
  font-size: 0.95rem;
}

.publication-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-xs);
}

.publication-doi {
  font-size: 0.85rem;
  margin-bottom: var(--spacing-sm);
}

.publication-doi a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* BibTeX Toggle */
.publication-bibtex {
  margin-top: var(--spacing-sm);
}

/* Publications List */
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  color: var(--dark-color);
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.publications-list {
  margin: var(--spacing-xl) 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.year-section {
  margin-bottom: var(--spacing-xl);
}

.year-header {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.6rem var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-lg);
}

.year-header h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--white);
}

.year-content {
  padding-right: var(--spacing-md);
}

/* Publication Row (number + card) */
.publication-row {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.publication-row:last-child {
  margin-bottom: 0;
}

.pub-number {
  flex-shrink: 0;
  width: 2.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
  text-align: right;
  padding-top: 0.15rem;
}

.publication-item {
  flex: 1;
  min-width: 0;
  background: var(--white);
  padding: var(--spacing-md);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color);
  transition: all 0.3s ease;
}

.publication-item:hover {
  box-shadow: var(--shadow-md);
}

.pub-title-line {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: var(--spacing-xs);
  line-height: 1.5;
}

.pub-authors-line {
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: var(--spacing-xs);
}

.pub-venue-line {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--spacing-xs);
}

.pub-links-line {
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.pub-links-line a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition-base);
}

.pub-links-line a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.bibtex-toggle {
  color: var(--primary-light);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.bibtex-toggle:hover {
  color: var(--primary-color);
}

.bibtex-toggle i {
  transition: transform 0.3s ease;
}

.bibtex-content {
  display: none;
  margin-top: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--light-gray);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  line-height: 1.6;
  max-width: 100%;
}

.bibtex-content.active {
  display: block;
}

.bibtex-content pre {
  background: var(--light-gray);
  padding: 1rem;
  border-radius: var(--border-radius);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  margin: 0;
  border-left: 3px solid var(--primary-color);
  font-family: var(--font-mono);
  max-width: 100%;
  white-space: pre;
}

.bibtex-content code {
  color: var(--dark-color);
}

.bibtex-chevron {
  transition: transform var(--transition-base);
}

.publications-error {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-muted);
}

.publications-error i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-md);
}

/* Button Variants */
.btn-lg {
  padding: 0.9rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}

/* Grid Variant */
.grid-1 {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  max-width: 900px;
  margin: 0 auto;
}

.grid-1>* {
  flex: none;
  width: 100%;
  max-width: 100%;
  min-width: auto;
}

/* Fade in animation for dynamically loaded content */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.research-item,
.news-item,
.talk-item,
.publication-item {
  animation: fadeIn 0.5s ease;
}

/* Responsive adjustments for dynamic content */
@media (max-width: 768px) {
  .publication-title {
    font-size: 1rem;
  }

  .publication-row {
    gap: 0.75rem;
  }

  .pub-number {
    width: 2rem;
    font-size: 0.85rem;
  }

  .bibtex-content {
    font-size: 0.7rem;
  }
}