@import url('fonts.css');

/* ==========================================================================
   HARMES-Consistent Design System & Theme Variables (Light / Dark / Auto)
   Zero External Requests · 100% GDPR Compliant
   ========================================================================== */

:root {
  /* Brand Palette derived from HARMES Logo & Website */
  --harmes-navy: #0b2239;
  --harmes-navy-light: #15385c;
  --harmes-blue: #2563eb;
  --harmes-blue-hover: #1d4ed8;
  --harmes-sky: #0ea5e9;
  --harmes-gold: #f59e0b;
  --harmes-gold-light: #fbbf24;
  --harmes-gold-dark: #d97706;
  --harmes-gold-bg: #fffbeb;
  --harmes-gold-border: #fde68a;

  /* Light Mode Surfaces & Text */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.88);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent-gold: #d97706;
  --accent-gold-bg: #fef3c7;
  --accent-gold-border: #fcd34d;

  /* Shadows & Radii (matching harmes-website) */
  --shadow-sm: 0 1px 2px 0 rgba(11, 34, 57, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(11, 34, 57, 0.08), 0 2px 4px -2px rgba(11, 34, 57, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(11, 34, 57, 0.1), 0 4px 6px -4px rgba(11, 34, 57, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(11, 34, 57, 0.12), 0 8px 10px -6px rgba(11, 34, 57, 0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1080px;
}

[data-theme="dark"] {
  --bg-primary: #091524;
  --bg-secondary: #0d1f33;
  --bg-tertiary: #142c47;
  --bg-card: #0f233a;
  --bg-nav: rgba(9, 21, 36, 0.88);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #1e3a5f;
  --border-strong: #2d4f7c;

  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --accent-gold: #fbbf24;
  --accent-gold-bg: rgba(245, 158, 11, 0.15);
  --accent-gold-border: rgba(251, 191, 36, 0.4);
  --harmes-gold-bg: rgba(245, 158, 11, 0.08);
  --harmes-gold-border: rgba(251, 191, 36, 0.35);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.55), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Reset & Base Typography
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

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

img, svg {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  flex: 1;
}

/* ==========================================================================
   Sticky Top Navigation Bar
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

/* Top Gold-Blue Accent Strip inspired by HARMES */
.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--harmes-navy) 0%, var(--harmes-blue) 45%, var(--harmes-gold) 100%);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--harmes-navy), var(--harmes-blue));
  border: 2px solid var(--harmes-gold);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.brand-subtitle {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  display: none;
}

@media (min-width: 640px) {
  .brand-subtitle {
    display: inline-block;
    padding-left: 0.65rem;
    border-left: 1px solid var(--border-color);
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-link.active {
  color: var(--primary-color);
  background: var(--primary-soft);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 0.9rem;
  right: 0.9rem;
  height: 2px;
  border-radius: 2px;
  background: var(--harmes-gold);
}

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

.theme-toggle, .mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle:hover, .mobile-menu-btn:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold-border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.mobile-menu-btn {
  display: none;
}

@media (max-width: 720px) {
  .mobile-menu-btn {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem 1rem;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open {
    display: flex;
  }
}

/* ==========================================================================
   Hero Section (Home Page)
   ========================================================================== */

.hero-section {
  padding: 4rem 0 3.25rem;
  background: radial-gradient(circle at 85% 15%, var(--harmes-gold-bg) 0%, transparent 45%),
              radial-gradient(circle at 10% 80%, var(--primary-soft) 0%, transparent 50%),
              var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.hero-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: center;
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
}

.profile-avatar-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--harmes-gold);
  box-shadow: var(--shadow-xl);
  background: var(--bg-card);
  transition: var(--transition);
}

.profile-avatar-wrap:hover .profile-avatar {
  transform: scale(1.02);
}

.profile-status-pill {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--harmes-navy);
  color: #ffffff;
  border: 2px solid var(--harmes-gold);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-border);
  margin-bottom: 0.9rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hero-affiliation {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.hero-affiliation a {
  font-weight: 600;
  border-bottom: 1px dashed var(--primary-color);
}

.hero-bio {
  font-size: 1.02rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 72ch;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 820px) {
  .research-tags {
    justify-content: center;
  }
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.78rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.tag-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--harmes-gold);
}

.tag-pill:nth-child(odd) .dot {
  background: var(--primary-color);
}

/* ==========================================================================
   Buttons & Social / Profile Links (Matching harmes-website button style)
   ========================================================================== */

.social-links-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

@media (max-width: 820px) {
  .social-links-bar {
    justify-content: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.2;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

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

.btn-primary {
  background: var(--harmes-navy);
  color: #ffffff;
  border-color: var(--harmes-navy);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-primary {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.btn-gold {
  background: linear-gradient(135deg, var(--harmes-gold) 0%, var(--harmes-gold-dark) 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

.btn-gold:hover {
  color: #ffffff;
  filter: brightness(1.06);
  box-shadow: var(--shadow-lg);
}

.btn-sm {
  padding: 0.38rem 0.78rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Section Headers & Page Banners
   ========================================================================== */

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 0.55rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--harmes-gold));
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-top: 0.35rem;
}

.page-hero {
  padding: 2.75rem 0 2.25rem;
  background: radial-gradient(circle at 90% 20%, var(--harmes-gold-bg) 0%, transparent 50%),
              var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.page-title {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.page-lead {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 70ch;
}

/* ==========================================================================
   Pinned / Highlighted Publication Cards
   ========================================================================== */

.pinned-grid {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.pub-card-pinned {
  background: var(--bg-card);
  border: 1.5px solid var(--harmes-gold-border);
  border-left: 5px solid var(--harmes-gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  position: relative;
}

.pub-card-pinned.featured-first {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--harmes-gold-bg) 100%);
  border-left: 5px solid var(--primary-color);
  border-color: var(--harmes-gold);
}

.pub-card-pinned:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.pub-card-icon {
  width: 78px;
  height: 78px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
  background: #ffffff;
  padding: 4px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .pub-card-pinned {
    flex-direction: column;
    padding: 1.25rem;
  }
  .pub-card-icon {
    width: 64px;
    height: 64px;
  }
}

.pub-card-body {
  flex: 1;
  min-width: 0;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-pinned {
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold-border);
}

.badge-year {
  background: var(--primary-soft);
  color: var(--primary-color);
}

.badge-type {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-citations {
  background: var(--primary-soft);
  color: var(--harmes-sky);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

[data-theme="dark"] .badge-citations {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.badge-citations-btn {
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.badge-citations-btn:hover {
  background: rgba(14, 165, 233, 0.16);
  border-color: var(--harmes-sky);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .badge-citations-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
}

.badge-citations-btn:focus-visible {
  outline: 2px solid var(--harmes-sky);
  outline-offset: 2px;
}

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

.pub-title a {
  color: inherit;
}

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

.pub-authors {
  font-size: 0.94rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.pub-authors .author-self {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--harmes-gold);
  text-underline-offset: 3px;
}

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

.pub-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 0.95rem;
}

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

/* ==========================================================================
   Chronological Publication List & Filter Controls
   ========================================================================== */

.pub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.9rem 0.55rem 2.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

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

.filter-btn {
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-btn.active {
  background: var(--harmes-navy);
  color: #ffffff;
  border-color: var(--harmes-navy);
}

[data-theme="dark"] .filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.year-group {
  margin-bottom: 2.5rem;
}

.year-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.year-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.year-count {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

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

.pub-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  transition: var(--transition);
}

.pub-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.bibtex-drawer {
  display: none;
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  color: var(--text-secondary);
  position: relative;
}

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

/* ==========================================================================
   CV Timeline & Cards (About / CV & Teaching Pages)
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 1.75rem;
  border-left: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

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

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.32rem;
  top: 1.5rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--harmes-gold);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--primary-color);
}

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

.timeline-role {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-period {
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-color);
}

.timeline-org {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.timeline-details {
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.timeline-details ul {
  padding-left: 1.2rem;
  margin-top: 0.4rem;
}

.timeline-details li + li {
  margin-top: 0.25rem;
}

/* Feature Cards Grid (Workshop & Teaching) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.35rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.info-card.gold-accent {
  border-top-color: var(--harmes-gold);
}

.info-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.info-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.5rem 0 0.4rem;
}

.info-card-meta {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.65rem;
}

.info-card-text {
  font-size: 0.94rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.25rem 0;
  margin-top: 3rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-weight: 500;
}

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

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

/* ==========================================================================
   Citations Popup Modal
   ========================================================================== */

body.modal-open {
  overflow: hidden;
}

.citations-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(9, 21, 36, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.citations-modal-backdrop[hidden] {
  display: none;
}

.citations-modal-backdrop.open {
  opacity: 1;
}

.citations-modal-dialog {
  width: 100%;
  max-width: 660px;
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
  border-top: 4px solid var(--harmes-gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.citations-modal-backdrop.open .citations-modal-dialog {
  transform: translateY(0) scale(1);
}

.citations-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.citations-modal-heading {
  min-width: 0;
  flex: 1;
}

.citations-modal-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.citations-modal-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.citations-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.citations-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.citations-modal-close:hover {
  color: var(--accent-gold);
  border-color: var(--accent-gold-border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.citations-modal-close:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.citations-modal-body {
  overflow-y: auto;
  padding: 1.15rem 1.35rem;
  flex: 1;
}

.citing-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.citing-item {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  transition: var(--transition);
}

.citing-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.citing-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.4;
  color: var(--text-primary);
}

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

.citing-title svg {
  flex-shrink: 0;
  transform: translateY(1px);
  color: var(--text-muted);
}

a.citing-title:hover svg {
  color: var(--primary-color);
}

.citing-authors {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-top: 0.32rem;
}

.citing-authors .author-self {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--harmes-gold);
  text-underline-offset: 2px;
}

.citing-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.citing-venue {
  font-size: 0.83rem;
  font-style: italic;
  color: var(--text-muted);
}

.citing-doi-link {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--primary-color);
}

.citing-doi-link:hover {
  border-color: var(--primary-color);
}

.citing-empty {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.citing-empty-hint {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.citations-modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.citations-modal-source {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.citations-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .citations-modal-backdrop {
    padding: 0.75rem;
  }
  .citations-modal-dialog {
    max-height: 88vh;
  }
  .citations-modal-header,
  .citations-modal-body,
  .citations-modal-footer {
    padding: 0.95rem 1rem;
  }
}

/* ==========================================================================
   Expandable Publication Cards & Abstract Accordion
   ========================================================================== */

.pub-expandable {
  cursor: pointer;
}

.pub-expandable .bibtex-drawer {
  cursor: text;
}

.pub-item.pub-expandable.is-expanded {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.pub-card-pinned.pub-expandable.is-expanded {
  border-color: var(--harmes-gold);
  box-shadow: var(--shadow-lg);
}

.abstract-hint-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.pub-expandable:hover .abstract-hint-btn,
.pub-expandable.is-expanded .abstract-hint-btn,
.abstract-hint-btn:hover {
  color: var(--primary-color);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.2);
}

.abstract-hint-btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.abstract-hint-btn svg {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.pub-expandable.is-expanded .abstract-hint-btn svg {
  transform: rotate(180deg);
}

.pub-abstract-collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.22s ease,
              margin 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.pub-expandable.is-expanded .pub-abstract-collapse {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.75rem;
  margin-bottom: 0.95rem;
}

.pub-abstract-inner {
  overflow: hidden;
  min-height: 0;
}

.pub-abstract-box {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary-color);
  cursor: text;
}

.pub-card-pinned .pub-abstract-box {
  border-left-color: var(--harmes-gold);
  background: var(--bg-card);
}

.pub-abstract-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  margin-bottom: 0.35rem;
}

.pub-card-pinned .pub-abstract-label {
  color: var(--accent-gold);
}

.pub-abstract-text {
  font-size: 0.91rem;
  line-height: 1.68;
  color: var(--text-secondary);
}

/* ==========================================================================
   Publication Metrics Bar & Hoverable Citations-per-Year Chart
   ========================================================================== */

.pub-stats-panel {
  margin-top: 1.65rem;
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 0.9rem;
  align-items: stretch;
}

.pub-stats-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition);
}

.stat-card.accent-gold {
  border-top-color: var(--harmes-gold);
}

.stat-card.accent-sky {
  border-top-color: var(--harmes-sky);
}

.stat-card.accent-navy {
  border-top-color: var(--harmes-navy-light);
}

[data-theme="dark"] .stat-card.accent-navy {
  border-top-color: #60a5fa;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.pub-stats-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--harmes-gold);
  border-radius: var(--radius-md);
  padding: 0.72rem 1rem 0.65rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0;
}

.chart-card-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.chart-card-range {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.55rem;
  height: 98px;
  padding-top: 2.2rem;
}

.chart-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  outline: none;
  position: relative;
}

.chart-bar-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar-anchor {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  max-width: 34px;
  height: 100%;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--harmes-sky) 0%, var(--primary-color) 100%);
  transition: transform 0.2s ease, background 0.2s ease, filter 0.2s ease;
}

.chart-bar.is-zero {
  background: var(--border-strong);
  opacity: 0.75;
}

.chart-col:hover .chart-bar,
.chart-col:focus-visible .chart-bar {
  background: linear-gradient(180deg, var(--harmes-gold-light) 0%, var(--harmes-gold) 100%);
  opacity: 1;
  transform: scaleY(1.04);
  transform-origin: bottom;
}

.chart-year {
  margin-top: 0.35rem;
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

.chart-col:hover .chart-year,
.chart-col:focus-visible .chart-year {
  color: var(--text-primary);
}

.chart-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.26rem 0.55rem;
  border-radius: 6px;
  background: var(--harmes-navy);
  color: #ffffff;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  box-shadow: var(--shadow-md);
  z-index: 20;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--harmes-navy);
}

[data-theme="dark"] .chart-tooltip {
  background: #f8fafc;
  color: #0f172a;
}

[data-theme="dark"] .chart-tooltip::after {
  border-top-color: #f8fafc;
}

.chart-col:hover .chart-tooltip,
.chart-col:focus-visible .chart-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 880px) {
  .pub-stats-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pub-stats-cards {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .citations-modal-backdrop,
  .citations-modal-dialog,
  .pub-abstract-collapse,
  .abstract-hint-btn svg,
  .stat-card,
  .chart-bar,
  .chart-tooltip {
    transition: none;
  }
}
