/* ============================================================
   RS/GIS PORTFOLIO — MAIN STYLES
   Kamalesh Kanna S | Ph.D. Research Scholar, TNAU
   ============================================================ */

/* ─── Google Fonts ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── CSS Custom Properties (Theme Variables) ──────────── */
:root {
  /* Dark Theme (Default) */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-tertiary: #171717;
  --bg-card: rgba(23, 23, 23, 0.75);
  --bg-card-hover: rgba(32, 32, 32, 0.9);
  --bg-glass: rgba(10, 10, 10, 0.85);
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent: #00b4d8;
  --accent-light: #48cae4;
  --accent-dark: #0096c7;
  --accent-glow: rgba(0, 180, 216, 0.3);
  --accent-secondary: #06d6a0;
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(0, 180, 216, 0.4);
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 50px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 30px rgba(0, 180, 216, 0.15);
  --nav-bg: rgba(0, 0, 0, 0.85);
  --scrollbar-track: #0a0a0a;
  --scrollbar-thumb: #333333;
  --tag-bg: rgba(0, 180, 216, 0.12);
  --tag-text: #48cae4;
  --timeline-line: rgba(0, 180, 216, 0.3);
  --skill-bar-bg: rgba(255, 255, 255, 0.08);
  --skill-bar: linear-gradient(90deg, #00b4d8, #06d6a0);
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.4);
  --gradient-hero: linear-gradient(135deg, #000000 0%, #121212 50%, #050505 100%);
  --gradient-accent: linear-gradient(135deg, #00b4d8, #06d6a0);
  --gradient-card: linear-gradient(145deg, rgba(28, 28, 28, 0.8), rgba(10, 10, 10, 0.6));

  /* Spacing */
  --section-padding: 100px 0;
  --container-max: 1200px;
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s ease;
  --transition-theme: 0.4s ease;
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.85);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #0284c7;
  --accent-light: #0ea5e9;
  --accent-dark: #0369a1;
  --accent-glow: rgba(2, 132, 199, 0.2);
  --accent-secondary: #059669;
  --border: rgba(15, 23, 42, 0.1);
  --border-hover: rgba(2, 132, 199, 0.4);
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 50px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(2, 132, 199, 0.1);
  --nav-bg: rgba(248, 250, 252, 0.85);
  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #cbd5e1;
  --tag-bg: rgba(2, 132, 199, 0.08);
  --tag-text: #0284c7;
  --timeline-line: rgba(2, 132, 199, 0.3);
  --skill-bar-bg: rgba(15, 23, 42, 0.06);
  --skill-bar: linear-gradient(90deg, #0284c7, #059669);
  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  --gradient-accent: linear-gradient(135deg, #0284c7, #059669);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.7));
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 16px;
  overflow-x: hidden;
  transition: background-color var(--transition-theme), color var(--transition-theme);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color var(--transition-theme), color var(--transition-theme);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Selection */
::selection {
  background: var(--accent);
  color: #fff;
}

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

a:hover {
  color: var(--accent-light);
}

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

/* ─── Scroll Progress Bar ──────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-accent);
  z-index: 10001;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent-glow);
  width: 0%;
}

/* ─── Navigation ───────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 10000;
  display: flex;
  align-items: center;
  transition: all var(--transition-normal);
  transform: translateY(-100%);
}

.navbar.visible {
  transform: translateY(0);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
  height: 60px;
}

.nav-container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--border-radius-full);
  transition: all var(--transition-normal);
  position: relative;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-normal);
}

.theme-toggle:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(180deg);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  gap: 6px;
  z-index: 10002;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.mobile-nav-overlay.active {
  opacity: 1;
}

/* Mobile Nav Panel */
.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: -300px;
  bottom: 0;
  width: 280px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 10001;
  padding: 90px 24px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: right var(--transition-normal), background-color var(--transition-theme);
}

.mobile-nav-panel.active {
  right: 0;
}

/* ─── Container & Section ──────────────────────────────── */
.container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: var(--section-padding);
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-theme);
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
}

.section-header h2 .accent {
  color: var(--accent);
}

.section-header .underline-animated {
  display: block;
  width: 0;
  height: 4px;
  background: var(--gradient-accent);
  border-radius: 2px;
  margin: 12px auto 0;
  transition: width 1s ease-out;
}

.section-header .underline-animated.animate {
  width: 80px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Hero Section ─────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--gradient-hero);
  padding-top: 70px;
}

.hero-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.orbit-ring {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.3;
  max-width: none;
}

.orbit-ring:nth-child(1) {
  width: 400px;
  height: 400px;
  animation: orbitSpin 20s linear infinite;
}

.orbit-ring:nth-child(2) {
  width: 600px;
  height: 600px;
  animation: orbitSpin 30s linear infinite reverse;
}

.orbit-ring:nth-child(3) {
  width: 800px;
  height: 800px;
  animation: orbitSpin 40s linear infinite;
}

.orbit-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow);
}

.orbit-ring:nth-child(1) .orbit-dot {
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}

.orbit-ring:nth-child(2) .orbit-dot {
  bottom: 0;
  right: 10%;
}

.orbit-ring:nth-child(3) .orbit-dot {
  top: 20%;
  left: 0;
}

#particles-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  width: 100%;
}

.hero-text {
  flex: 1;
  max-width: 600px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(20px);
}

.hero-name {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(20px);
}

.hero-name .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-wrapper {
  height: 36px;
  margin-bottom: 24px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
}

.hero-title {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-title .cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(20px);
}

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

.stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
  font-family: 'JetBrains Mono', monospace;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--border-radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

.hero-image-wrapper {
  position: relative;
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(20px);
}

.hero-image {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 2;
  border: 4px solid var(--accent);
}

.hero-image-border {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: var(--gradient-accent);
  z-index: 1;
  animation: rotateBorder 3s linear infinite;
  opacity: 0.6;
}

.hero-image-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: var(--accent-glow);
  z-index: 0;
  filter: blur(20px);
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ─── About Section ────────────────────────────────────── */
#about {
  background: var(--bg-secondary);
}

.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 60px;
  align-items: center;
}

.about-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.about-image-container {
  position: relative;
  width: 260px;
  height: 260px;
}

.about-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-lg);
  position: relative;
  z-index: 2;
}

.about-image-border {
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  background: var(--gradient-accent);
  z-index: 1;
  animation: rotateBorder 4s linear infinite;
  opacity: 0.7;
}

.about-text h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.about-text .subtitle {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 20px;
  font-size: 1rem;
}

.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.about-social {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.social-link {
  width: 42px;
  height: 42px;
  border-radius: var(--border-radius);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.social-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* ─── Research Interests ───────────────────────────────── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.research-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 28px 24px;
  text-align: center;
  transition: all var(--transition-normal);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-accent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

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

.research-card:hover::before {
  opacity: 0.05;
}

.research-card-icon {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  transition: all var(--transition-normal);
}

.research-card:hover .research-card-icon {
  transform: scale(1.2);
}

.research-card-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

/* ─── Publications Section ─────────────────────────────── */
.pub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}

.pub-tab {
  padding: 8px 20px;
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
}

.pub-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pub-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pub-count {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 4px;
}

.pub-tab.active .pub-count {
  opacity: 1;
  color: rgba(255, 255, 255, 0.9);
}

.pub-container {
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.pub-panel {
  display: none;
}

.pub-panel.active {
  display: block;
  animation: fadeSlideUp 0.4s ease forwards;
}

.pub-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: all var(--transition-normal);
}

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

.pub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.pub-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
  flex: 1;
}

.pub-card .pub-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  background: var(--tag-bg);
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  white-space: nowrap;
  font-weight: 600;
}

.pub-card .pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

.pub-card .pub-venue {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  font-style: italic;
}

.pub-abstract-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast);
}

.pub-abstract-toggle:hover {
  color: var(--accent-light);
}

.pub-abstract {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.pub-abstract.open {
  max-height: 500px;
  padding-top: 12px;
  opacity: 1;
}

.pub-abstract p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pub-tag {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--border-radius-full);
  background: var(--tag-bg);
  color: var(--tag-text);
  font-weight: 500;
}

.pub-card-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pub-link:hover {
  color: var(--accent-light);
  transform: translateX(3px);
}

/* ─── Education Timeline ───────────────────────────────── */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 40px;
}

.timeline-line {
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--timeline-line);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.5s ease;
}

.timeline-line.animate {
  transform: scaleY(1);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  opacity: 0;
}

.timeline-item:nth-child(odd) {
  animation: slideInLeft 0.6s ease forwards;
}

.timeline-item:nth-child(even) {
  animation: slideInRight 0.6s ease forwards;
}

.timeline-dot {
  position: absolute;
  left: -40px;
  top: 24px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-primary);
  z-index: 2;
  transition: background-color var(--transition-theme);
}

.timeline-dot.pulse {
  animation: dotPulse 1.5s ease-in-out;
}

.timeline-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  transition: all var(--transition-normal);
}

.timeline-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateX(4px);
}

.timeline-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.timeline-card .timeline-degree {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-card .timeline-institution {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.timeline-card .timeline-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.timeline-card .timeline-marks {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent-secondary);
  background: rgba(6, 214, 160, 0.1);
  padding: 2px 10px;
  border-radius: var(--border-radius-full);
  font-weight: 600;
  margin-bottom: 8px;
}

.timeline-card .timeline-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── Skills Section ───────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.skill-category {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 28px;
  transition: all var(--transition-normal);
}

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

.skill-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.skill-category-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius);
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.2rem;
}

.skill-category h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.skill-item {
  margin-bottom: 16px;
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.skill-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.skill-level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.skill-bar-bg {
  height: 8px;
  background: var(--skill-bar-bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.skill-bar-fill {
  height: 100%;
  background: var(--skill-bar);
  border-radius: 4px;
  width: 0;
  transition: width 1.2s ease-out;
  position: relative;
}

.skill-bar-fill.animate {
  /* width set via JS */
}

.skill-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s ease-in-out infinite;
}

/* ─── Animated Skill Boxes with Dotted Border ─────────── */
.skill-box {
  display: inline-block;
  padding: 12px 16px;
  border: 2px dotted rgba(0, 180, 216, 0.6);
  border-radius: 8px;
  background: rgba(0, 180, 216, 0.05);
  transition: all 0.3s ease;
  animation: dottedBorderPulse 3s ease-in-out infinite;
}

.skill-box:hover {
  border-color: rgba(0, 180, 216, 0.9);
  background: rgba(0, 180, 216, 0.1);
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.4);
}

.skill-box .skill-name {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
}

@keyframes dottedBorderPulse {

  0%,
  100% {
    border-color: rgba(0, 180, 216, 0.3);
    box-shadow: 0 0 8px rgba(0, 180, 216, 0);
  }

  50% {
    border-color: rgba(0, 180, 216, 0.8);
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.3);
  }
}

/* ─── Activities/Certifications ────────────────────────── */
.activities-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}

.activities-tab {
  padding: 8px 20px;
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
}

.activities-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.activities-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.activities-panel {
  display: none;
}

.activities-panel.active {
  display: block;
  animation: fadeSlideUp 0.4s ease forwards;
}

.cert-list {
  list-style: none;
}

.cert-group-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.cert-group-title:first-child {
  margin-top: 0;
}

.cert-item {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.cert-item:hover {
  border-color: var(--border-hover);
}

.cert-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  gap: 12px;
  transition: background var(--transition-fast);
}

.cert-item-header:hover {
  background: var(--bg-tertiary);
}

.cert-item-info {
  flex: 1;
}

.cert-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.cert-item-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cert-view-btn {
  background: var(--tag-bg);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: var(--border-radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cert-view-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.cert-chevron {
  transition: transform var(--transition-normal);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cert-item.expanded .cert-chevron {
  transform: rotate(180deg);
}

.cert-item-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.cert-item.expanded .cert-item-body {
  max-height: 1000px;
}

.cert-item-body-content {
  padding: 0 20px 16px;
}

/* Accordion sub-items */
.cert-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.cert-sub-item:last-child {
  border-bottom: none;
}

.cert-sub-item-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  flex: 1;
}

.cert-sub-item-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cert-sub-view-btn {
  background: var(--tag-bg);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
  white-space: nowrap;
}

.cert-sub-view-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ─── Awards Section ───────────────────────────────────── */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.award-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 28px;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.award-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 30px var(--gold-glow);
  transform: translateY(-4px);
}

.award-icon {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 16px;
  animation: goldenPulse 2s ease-in-out infinite;
}

.award-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.award-card .award-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}

.award-view-btn {
  margin-top: 12px;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: var(--border-radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: inherit;
}

.award-view-btn:hover {
  background: var(--gold);
  color: #000;
}

/* ─── Contact Section ──────────────────────────────────── */
#contact {
  background: var(--bg-secondary);
}

.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-content p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.contact-link::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.contact-link:hover {
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.contact-link:hover::after {
  opacity: 1;
}

.contact-link i,
.contact-link span {
  position: relative;
  z-index: 1;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--gradient-accent);
  color: #fff;
  border-radius: var(--border-radius-full);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.contact-email:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
  color: #fff;
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: rippleEffect 0.6s ease-out;
  pointer-events: none;
  z-index: 0;
}

/* ─── Footer ───────────────────────────────────────────── */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  transition: background-color var(--transition-theme);
}

footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}

/* ─── Scroll to Top Button ─────────────────────────────── */
.scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-full);
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-normal);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  z-index: 9999;
}

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

.scroll-top-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

/* ─── Certificate Lightbox Modal ───────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.8);
  transition: transform var(--transition-normal);
}

.lightbox-overlay.active .lightbox-container {
  transform: scale(1);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 800px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.lightbox-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

.lightbox-counter {
  color: rgba(255, 255, 255, 0.6);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin-left: 16px;
}

.lightbox-close {
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-normal);
  flex-shrink: 0;
}

.lightbox-close:hover {
  border-color: #ff4757;
  color: #ff4757;
  transform: rotate(90deg);
  background: rgba(255, 71, 87, 0.1);
}

.lightbox-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 800px;
  width: 100%;
}

.lightbox-image-wrapper {
  max-width: 100%;
  max-height: 75vh;
  overflow: hidden;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.lightbox-image-wrapper img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  transition: transform var(--transition-normal);
  cursor: zoom-in;
}

.lightbox-image-wrapper img:hover {
  transform: scale(1.05);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-normal);
  z-index: 2;
}

.lightbox-nav:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.lightbox-nav.prev {
  left: -56px;
}

.lightbox-nav.next {
  right: -56px;
}

.lightbox-fallback {
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 60px 40px;
  font-size: 1rem;
}

.lightbox-fallback i {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.3);
}

/* ─── Loading / Empty States ───────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.empty-state p {
  font-size: 0.95rem;
}

/* ─── Utility Classes ──────────────────────────────────── */
.text-accent {
  color: var(--accent);
}

.text-muted {
  color: var(--text-muted);
}

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

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}
/* Certificate button inside publication cards (styled like .pub-link) */
button.pub-cert-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

/* ─── Medal badges (1st / 2nd / 3rd place) ────────────── */
.medal-gold   { --medal: #fbbf24; --medal-bg: rgba(251, 191, 36, 0.1); }
.medal-silver { --medal: #a8b3c2; --medal-bg: rgba(168, 179, 194, 0.12); }
.medal-bronze { --medal: #cd7f32; --medal-bg: rgba(205, 127, 50, 0.12); }
[data-theme="light"] .medal-gold   { --medal: #b7791f; }
[data-theme="light"] .medal-silver { --medal: #64748b; }
[data-theme="light"] .medal-bronze { --medal: #a0522d; }
.medal-icon { color: var(--medal); margin-right: 4px; }
.cert-view-btn.medal-btn { background: var(--medal-bg); border-color: var(--medal); color: var(--medal); }
.cert-view-btn.medal-btn:hover { background: var(--medal); color: #000; }

/* ─── Google Scholar add-ons (js/scholar.js) ───────────── */
.stat-sub { font-size: 0.68rem; color: var(--text-muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; min-height: 1em; }
.hero-cite-chart { margin: -12px 0 28px; animation: fadeSlideUp 0.6s ease both; }
.hero-cite-chart[hidden] { display: none; }
.cc-title { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; font-weight: 500; }
.cc-title span { text-transform: none; letter-spacing: 0; opacity: 0.8; }
.hero-cite-chart svg { overflow: visible; display: block; }
.cc-bar { fill: var(--accent); opacity: 0.85; transition: opacity var(--transition-fast); }
.hero-cite-chart g:hover .cc-bar { opacity: 1; }
.cc-val { fill: var(--text-secondary); font: 600 11px 'JetBrains Mono', monospace; text-anchor: middle; }
.cc-year { fill: var(--text-muted); font: 500 10px 'JetBrains Mono', monospace; text-anchor: middle; }

.pub-sort { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -20px 0 16px; font-size: 0.8rem; color: var(--text-muted); }
.pub-sort-btn { background: none; border: 1px solid var(--border); color: var(--text-secondary); border-radius: var(--border-radius-full); padding: 4px 12px; font: 600 0.78rem inherit; font-family: inherit; cursor: pointer; transition: all var(--transition-fast); }
.pub-sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.pub-sort-btn.active { background: var(--tag-bg); border-color: var(--accent); color: var(--accent); }

.pub-cited-badge { font: 600 0.78rem 'JetBrains Mono', monospace; color: var(--gold); background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.35); padding: 3px 10px; border-radius: var(--border-radius-full); white-space: nowrap; text-decoration: none; transition: all var(--transition-fast); }
.pub-cited-badge:hover { background: var(--gold); color: #000; }
[data-theme="light"] .pub-cited-badge { color: #b7791f; border-color: rgba(183, 121, 31, 0.4); }
.pub-scholar-record { font-size: 0.8rem; color: var(--text-secondary); margin: -4px 0 10px; }
.pub-scholar-record i { color: var(--text-muted); margin-right: 4px; }
.pub-spark { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-top: 12px; }
.pub-spark-label { font-size: 0.7rem; color: var(--text-muted); align-self: center; margin-right: 6px; }
.pub-spark-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; width: 18px; }
.pub-spark-bar { width: 12px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: 0.8; }
.pub-spark-year { font: 500 0.6rem 'JetBrains Mono', monospace; color: var(--text-muted); }
.pub-card-actions { flex-wrap: wrap; }
button.pub-cite-btn { background: none; border: none; padding: 0; font-family: inherit; cursor: pointer; }

.pub-top-cited, .pub-coauthors { margin-bottom: 28px; }
.pub-coauthors { margin-top: 36px; }
.ptc-title { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.ptc-title i { color: var(--accent); margin-right: 6px; }
.ptc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ptc-card { text-align: left; display: flex; flex-direction: column; gap: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--border-radius); padding: 16px; color: inherit; font-family: inherit; cursor: pointer; transition: all var(--transition-normal); }
.ptc-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.ptc-rank { font: 700 0.75rem 'JetBrains Mono', monospace; color: var(--accent); }
.ptc-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
.ptc-venue { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.ptc-cites { font: 600 0.78rem 'JetBrains Mono', monospace; color: var(--gold); margin-top: auto; }
[data-theme="light"] .ptc-cites { color: #b7791f; }
@keyframes pubFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 2px var(--accent), var(--shadow-glow); } }
.pub-card.pub-flash { animation: pubFlash 1.6s ease; }

.coauthor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.coauthor { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--border-radius); text-decoration: none; transition: border-color var(--transition-fast); }
.coauthor:hover { border-color: var(--border-hover); }
.coauthor-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tag-bg); color: var(--accent); font: 700 0.8rem 'JetBrains Mono', monospace; }
.coauthor-text { display: flex; flex-direction: column; min-width: 0; }
.coauthor-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.coauthor-aff { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cite-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); display: none; align-items: center; justify-content: center; z-index: 10001; padding: 16px; }
.cite-overlay.open { display: flex; }
.cite-box { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--border-radius-lg); width: min(720px, 100%); max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.cite-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text-primary); }
.cite-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.cite-close:hover { color: var(--accent); }
.cite-body { overflow-y: auto; padding: 12px 20px 16px; }
.cite-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cite-row > .cite-copy + .cite-copy { grid-column: 3; }
.cite-style { font-size: 0.8rem; font-weight: 700; color: var(--accent); padding-top: 2px; }
.cite-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; word-break: break-word; }
.cite-bib { font: 0.75rem/1.5 'JetBrains Mono', monospace; white-space: pre-wrap; margin: 0; }
.cite-copy { background: var(--tag-bg); border: 1px solid var(--accent); color: var(--accent); border-radius: var(--border-radius-full); padding: 4px 10px; font: 600 0.72rem inherit; font-family: inherit; cursor: pointer; white-space: nowrap; text-decoration: none; text-align: center; }
.cite-copy:hover { background: var(--accent); color: #fff; }
.cite-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 10px; }
@media (max-width: 560px) {
  .cite-row { grid-template-columns: 1fr auto; }
  .cite-style { grid-column: 1 / -1; }
  .cite-row > .cite-copy + .cite-copy { grid-column: 2; }
  .pub-sort { justify-content: center; margin-top: -16px; }
  .pub-card-header { flex-wrap: wrap; }
}
@media (max-width: 1024px) {
  .hero-cite-chart:not([hidden]) { display: flex; flex-direction: column; align-items: center; }
}
.hero-actions { flex-wrap: wrap; }
.hero-actions .btn { white-space: nowrap; }

/* ─── Certificate viewer: animated flowing background ──── */
.lightbox-overlay {
  --lb-base: #000000;
  --lb-flow: linear-gradient(120deg, #000000 0%, #0d0d0d 25%, #1a1a1a 50%, #0a0a0a 75%, #000000 100%);
  --lb-glow-1: rgba(0, 180, 216, 0.18);
  --lb-glow-2: rgba(6, 214, 160, 0.12);
  --lb-glow-3: rgba(255, 255, 255, 0.05);
  --lb-text: #ffffff;
  --lb-muted: rgba(255, 255, 255, 0.6);
  --lb-line: rgba(255, 255, 255, 0.3);
  --lb-btn: rgba(255, 255, 255, 0.1);
  background: var(--lb-flow);
  background-color: var(--lb-base);
  background-size: 400% 400%;
  animation: lbFlow 18s ease-in-out infinite;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: hidden;
}
[data-theme="light"] .lightbox-overlay {
  --lb-base: #ffffff;
  --lb-flow: linear-gradient(120deg, #ffffff 0%, #f4f6f8 25%, #e9edf1 50%, #f8fafc 75%, #ffffff 100%);
  --lb-glow-1: rgba(2, 132, 199, 0.14);
  --lb-glow-2: rgba(5, 150, 105, 0.10);
  --lb-glow-3: rgba(15, 23, 42, 0.05);
  --lb-text: #0f172a;
  --lb-muted: rgba(15, 23, 42, 0.6);
  --lb-line: rgba(15, 23, 42, 0.25);
  --lb-btn: rgba(15, 23, 42, 0.06);
}
.lightbox-overlay::before,
.lightbox-overlay::after {
  content: "";
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  z-index: 0;
}
.lightbox-overlay::before {
  background: radial-gradient(circle, var(--lb-glow-1) 0%, transparent 65%);
  top: -30vmax; left: -20vmax;
  animation: lbDrift1 22s ease-in-out infinite alternate;
}
.lightbox-overlay::after {
  background: radial-gradient(circle, var(--lb-glow-2) 0%, var(--lb-glow-3) 35%, transparent 65%);
  bottom: -35vmax; right: -25vmax;
  animation: lbDrift2 26s ease-in-out infinite alternate;
}
.lightbox-container { position: relative; z-index: 1; }
.lightbox-title { color: var(--lb-text); }
.lightbox-counter { color: var(--lb-muted); }
.lightbox-close, .lightbox-nav { color: var(--lb-text); border-color: var(--lb-line); background: var(--lb-btn); }
.lightbox-overlay img { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }

@keyframes lbFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes lbDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(35vw, 20vh) scale(1.15); }
  100% { transform: translate(15vw, 45vh) scale(0.95); }
}
@keyframes lbDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-30vw, -25vh) scale(1.1); }
  100% { transform: translate(-45vw, -10vh) scale(0.9); }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay, .lightbox-overlay::before, .lightbox-overlay::after { animation: none; }
}

/* ─── PDF viewer inside the certificate lightbox (js/pdfviewer.js) ─── */
.lightbox-body.pdf-open { max-width: min(900px, 100%); }
.lightbox-image-wrapper.pdf-mode {
  width: 100%;
  height: 75vh;
  max-height: 75vh;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: var(--lb-btn);
  border: 1px solid var(--lb-line);
}
.pdf-toolbar {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  color: var(--lb-text);
  font: 600 0.8rem 'JetBrains Mono', monospace;
  border-bottom: 1px solid var(--lb-line);
}
.pdf-tools { display: inline-flex; align-items: center; gap: 6px; }
.pdf-tools button, .pdf-tools a {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--lb-line);
  background: var(--lb-btn);
  color: var(--lb-text);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}
.pdf-tools button:hover, .pdf-tools a:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.pdf-zoom { min-width: 44px; text-align: center; color: var(--lb-muted); }
.pdf-scroll {
  position: relative;
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pdf-page {
  flex: none;
  position: relative;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.pdf-page canvas { display: block; }
.pdf-status { margin: auto; text-align: center; color: var(--lb-muted); padding: 40px 20px; font-size: 0.95rem; }
.pdf-status i { display: block; font-size: 2.2rem; margin-bottom: 12px; }
.pdf-status a { color: var(--accent); }
@media (max-width: 768px) {
  .lightbox-image-wrapper.pdf-mode { height: 70vh; max-height: 70vh; }
  .pdf-toolbar { padding: 6px 10px; }
}
/* keep the prev/next arrows outside the PDF page */
.lightbox-body.pdf-open { padding: 0 56px; }
.lightbox-body.pdf-open .lightbox-nav.prev { left: 0; }
.lightbox-body.pdf-open .lightbox-nav.next { right: 0; }
@media (max-width: 768px) {
  .lightbox-body.pdf-open { padding: 0; }
}

/* ─── Badge marquee (About section, js/badges.js) ─── */
.about-text { min-width: 0; }
.badge-marquee {
  margin-top: 22px;
  max-width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.badge-track {
  display: flex;
  width: max-content;
  animation: badgeMove var(--badge-time, 60s) linear infinite;
}
.badge-marquee:hover .badge-track { animation-play-state: paused; }
.badge-item {
  flex: none;
  margin-right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 48px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.55rem;
  text-align: center;
  line-height: 1.25;
}
.badge-item img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: transform var(--transition-normal);
}
.badge-item:hover img { transform: scale(1.12); }
@keyframes badgeMove {
  from { transform: translateX(0); }
  to { transform: translateX(var(--badge-shift, -50%)); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-track { animation-duration: calc(var(--badge-time, 60s) * 3); }
}

.badge-marquee.static { -webkit-mask-image: none; mask-image: none; }
.badge-marquee.static .badge-track { animation: none; }
