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

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
  /* Theme Colors - Grayscale + Teal Spark */
  --bg-color: #111111;
  --bg-gradient: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  --bg-size: 24px 24px;
  --bg-surface: #1a1a1a;
  
  /* Accents */
  --primary: #2DD4BF;
  --primary-rgb: 45, 212, 191;
  --secondary: #64748B;
  --secondary-rgb: 100, 116, 139;
  --tertiary: #334155;
  --tertiary-rgb: 51, 65, 85;
  
  /* Text Colors */
  --text-main: #ffffff;
  --text-muted: #b0b8c8;
  --text-dark: #6b7280;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --backdrop-blur: blur(20px);
  
  /* Typography */
  --font-body: 'Space Mono', monospace;
  --font-heading: 'Space Grotesk', sans-serif;
  
  /* Responsive Typography Scale using clamp */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-3xl: clamp(2rem, 1.6rem + 2vw, 3rem);
  --text-4xl: clamp(2.5rem, 1.8rem + 3.5vw, 4rem);
  --text-5xl: clamp(3rem, 2rem + 5vw, 5.5rem);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;
  
  /* Borders & Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 50%;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Shadows & Glows */
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glow-primary: 0 0 20px rgba(var(--primary-rgb), 0.3);
  --glow-secondary: 0 0 20px rgba(var(--secondary-rgb), 0.3);
  --glow-tertiary: 0 0 20px rgba(var(--tertiary-rgb), 0.3);
  
  /* Z-index */
  --z-back: -10;
  --z-normal: 1;
  --z-above: 10;
  --z-nav: 100;
  --z-dropdown: 200;
  --z-overlay: 1000;
  --z-modal: 1050;
  --z-loader: 2000;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-color: #f8fafc;
  --bg-gradient: radial-gradient(rgba(0, 0, 0, 0.07) 1px, transparent 1px);
  --bg-size: 24px 24px;
  --bg-surface: #ffffff;
  
  --primary: #0F766E;
  --primary-rgb: 15, 118, 110;
  --secondary: #94A3B8;
  --secondary-rgb: 148, 163, 184;
  --tertiary: #CBD5E1;
  --tertiary-rgb: 203, 213, 225;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dark: #64748b;
  
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.9);
  
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   2. Reset and Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-size: var(--bg-size, auto);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

ul, ol {
  list-style: none;
}

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

a:hover, a:focus {
  color: var(--primary);
  outline: none;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

/* ==========================================================================
   19. Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

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

/* ==========================================================================
   3. Typography Scale
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800; /* Extra bold to match reference */
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.04em; /* Tighter tracking for display look */
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.05em; font-weight: 900; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.text-gradient {
  background: linear-gradient(to right, var(--primary), var(--secondary), var(--tertiary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-size: 200% auto;
  animation: gradientShift 5s ease infinite;
}

/* ==========================================================================
   7. Layouts & Containers
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

section {
  padding: var(--space-xl) 0;
  position: relative;
  z-index: var(--z-normal);
}

.hero-title {
  font-weight: 900;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.05em;
}

.hero-letter {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s ease;
  will-change: transform;
}

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

.section-title h2 {
  display: inline-block;
  position: relative;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: var(--glow-primary);
}

/* ==========================================================================
   28. Loading Screen
   ========================================================================== */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-color);
  z-index: var(--z-loader);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

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

/* ==========================================================================
   17. Scroll Progress
   ========================================================================== */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  width: 0%;
  z-index: calc(var(--z-nav) + 1);
  transition: width 0.1s ease;
}

/* ==========================================================================
   4. Navigation Bar
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--space-sm) 0;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--glass-border);
  z-index: var(--z-nav);
  transition: padding var(--transition-normal), background var(--transition-normal);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  background: rgba(10, 14, 26, 0.8);
  box-shadow: var(--shadow-glass);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--primary);
}

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

.nav-item {
  position: relative;
  font-weight: 500;
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-normal);
  box-shadow: var(--glow-primary);
}

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

.theme-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background: var(--glass-hover);
  box-shadow: var(--glow-primary);
  color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: calc(var(--z-nav) + 1);
}

.mobile-menu-btn span {
  display: block;
  width: 30px;
  height: 2px;
  background: var(--text-main);
  transition: var(--transition-normal);
}

/* ==========================================================================
   5. Hero Section & 21/22. Particles & Backgrounds
   ========================================================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--space-xl);
}

#particles-js {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-back);
}

.floating-shapes .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  z-index: var(--z-back);
  opacity: 0.5;
  animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: rgba(var(--primary-rgb), 0.2);
  top: 10%;
  left: -10%;
}
.shape-2 {
  width: 400px;
  height: 400px;
  background: rgba(var(--secondary-rgb), 0.15);
  bottom: 20%;
  right: -5%;
  animation-delay: -5s;
}
.shape-3 {
  width: 250px;
  height: 250px;
  background: rgba(var(--tertiary-rgb), 0.2);
  top: 40%;
  left: 40%;
  animation-delay: -2s;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  z-index: var(--z-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
  display: block;
}

.typewriter-container {
  min-height: 60px;
}

.typewriter {
  font-size: var(--text-2xl);
  color: var(--text-muted);
  border-right: 2px solid var(--primary);
  white-space: nowrap;
  overflow: hidden;
  margin: 0 auto;
  animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

.hero-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-size: var(--text-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  border: none;
  box-shadow: var(--glow-primary);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(45deg, var(--secondary), var(--tertiary));
  z-index: -1;
  transition: opacity var(--transition-normal);
  opacity: 0;
}

.btn-primary:hover::before {
  opacity: 1;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-secondary);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--backdrop-blur);
}

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

/* ==========================================================================
   6. Profile Photo
   ========================================================================== */
.profile-wrapper {
  position: relative;
  width: 250px;
  height: 250px;
  margin: 0 auto var(--space-md);
  border-radius: var(--radius-full);
  z-index: var(--z-normal);
}

.profile-wrapper::before, .profile-wrapper::after {
  content: '';
  position: absolute;
  top: -10px; right: -10px; bottom: -10px; left: -10px;
  border-radius: var(--radius-full);
  background: linear-gradient(45deg, var(--primary), var(--secondary), var(--tertiary), var(--primary));
  z-index: -1;
  background-size: 400%;
  animation: gradientShift 10s linear infinite;
}

.profile-wrapper::after {
  filter: blur(20px);
  opacity: 0.7;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-full);
  border: 4px solid var(--bg-color);
}

/* ==========================================================================
   8. Glass Cards
   ========================================================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-glass);
}

.glass-card:hover {
  transform: translateY(-5px);
  background: var(--glass-hover);
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: var(--glow-primary);
}

/* ==========================================================================
   9. Skill Bars
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
}

.skill-item {
  margin-bottom: var(--space-sm);
}

.skill-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.skill-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.skill-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  width: 0; /* Set dynamically or via intersection observer */
  transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
  box-shadow: var(--glow-primary);
}

/* ==========================================================================
   10. Timeline Component
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-lg);
}

.timeline-dot {
  position: absolute;
  left: -3rem;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 3px solid var(--primary);
  transform: translateX(-50%);
  box-shadow: var(--glow-primary);
  z-index: 2;
  transition: all var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
  background: var(--primary);
  transform: translateX(-50%) scale(1.2);
}

.timeline-date {
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  font-size: var(--text-xl);
  margin-bottom: 0.25rem;
}

.timeline-content h4 {
  font-size: var(--text-md);
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 1rem;
}

/* ==========================================================================
   11. Research Project Cards
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--space-md);
}

.project-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--glow-primary);
  border-color: rgba(var(--primary-rgb), 0.5);
}

.project-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.project-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 26, 0.9), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-links {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.project-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.project-links a:hover {
  background: var(--primary);
  color: #000;
  box-shadow: var(--glow-primary);
}

.project-content {
  padding: var(--space-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  font-size: var(--text-xs);
  padding: 0.25rem 0.75rem;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  border-radius: 20px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

/* ==========================================================================
   23. Publication Cards
   ========================================================================== */
.pub-card {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  transition: all var(--transition-normal);
}

.pub-card:hover {
  background: var(--glass-hover);
  border-left: 4px solid var(--primary);
  transform: translateX(10px);
}

.pub-year {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--primary);
  min-width: 80px;
}

.pub-info h3 {
  font-size: var(--text-lg);
  margin-bottom: 0.5rem;
}

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

.pub-journal {
  font-weight: 600;
  color: var(--secondary);
}

/* ==========================================================================
   12 & 13. Gallery Masonry & Lightbox
   ========================================================================== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 200px;
  gap: 1rem;
  grid-auto-flow: dense;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}

.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 26, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-icon {
  color: #fff;
  font-size: 2rem;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.gallery-item:hover .gallery-icon {
  transform: translateY(0);
}

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

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

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

/* ==========================================================================
   22. Counter / Stats Section
   ========================================================================== */
.stats-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

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

.stat-number {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-number::after {
  content: '+';
  color: var(--primary);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   14. Certificates
   ========================================================================== */
.cert-slider {
  display: flex;
  overflow-x: auto;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  scroll-snap-type: x mandatory;
}

.cert-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
}

.cert-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid var(--glass-border);
}

/* ==========================================================================
   15. Contact Form with Floating Labels
   ========================================================================== */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  transition: all var(--transition-normal);
}

.contact-item:hover .contact-icon {
  background: var(--primary);
  color: #000;
  box-shadow: var(--glow-primary);
  transform: scale(1.1);
}

.form-group {
  position: relative;
  margin-bottom: 2rem;
}

.form-input {
  width: 100%;
  padding: 1rem 0;
  font-size: var(--text-base);
  color: var(--text-main);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--glass-border);
  transition: border-color var(--transition-normal);
}

.form-input:focus {
  border-bottom-color: var(--primary);
}

.form-label {
  position: absolute;
  top: 1rem;
  left: 0;
  font-size: var(--text-base);
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--transition-normal);
}

.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
  top: -0.5rem;
  font-size: var(--text-xs);
  color: var(--primary);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

/* ==========================================================================
   29. Section Dividers (SVG Waves)
   ========================================================================== */
.divider {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: translateY(100%);
  z-index: var(--z-normal);
}

.divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 150px;
}

.divider .shape-fill {
  fill: var(--bg-surface);
}

/* ==========================================================================
   16. Footer
   ========================================================================== */
footer {
  position: relative;
  background: var(--bg-surface);
  padding: var(--space-lg) 0 var(--space-sm);
  border-top: 1px solid var(--glass-border);
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
}

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

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  transition: all var(--transition-normal);
}

.social-links a:hover {
  background: var(--primary);
  color: #000;
  box-shadow: var(--glow-primary);
  transform: translateY(-5px);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--glass-border);
  color: var(--text-dark);
  font-size: var(--text-sm);
}

/* ==========================================================================
   18. Back to Top Button
   ========================================================================== */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: var(--z-nav);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
}

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

#back-to-top:hover {
  background: var(--primary);
  color: #000;
  box-shadow: var(--glow-primary);
}

/* ==========================================================================
   25. Animations (Keyframes)
   ========================================================================== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0% { transform: translateY(0) translateX(0) rotate(0deg); }
  50% { transform: translateY(-20px) translateX(20px) rotate(5deg); }
  100% { transform: translateY(0) translateX(0) rotate(0deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--primary); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-on-scroll {
  opacity: 0;
}

.animate-on-scroll.is-visible {
  animation: fadeInUp 0.8s forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* ==========================================================================
   24. Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .contact-container {
    grid-template-columns: 1fr;
  }
  
  .timeline::before {
    left: 20px;
  }
  .timeline {
    padding-left: 50px;
  }
  .timeline-dot {
    left: -30px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(10, 14, 26, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    transition: left var(--transition-normal);
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }
  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }
  
  .hero-content {
    margin-top: 3rem;
  }
  
  .pub-card {
    flex-direction: column;
    gap: 1rem;
  }
  .pub-year {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  .stats-container {
    flex-direction: column;
  }
  .gallery-item.wide { grid-column: span 1; }
  .gallery-item.tall { grid-row: span 1; }
}

/* ==========================================================================
   26. Prefers Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .text-gradient, .profile-wrapper::before, .profile-wrapper::after {
    animation: none;
    background-size: 100%;
  }
}
