/* ============================================
   JACK LIU - MODERN PORTFOLIO CSS
   Professional AI Researcher & ML Engineer
   ============================================ */

/* CSS Variables */
:root {
  /* Colors - Deep Professional Theme */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --bg-card: rgba(26, 26, 37, 0.8);
  
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;
  
  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --accent-glow: rgba(99, 102, 241, 0.4);
  
  --academic-color: #22d3ee;
  --industry-color: #f472b6;
  --success-color: #10b981;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Spacing */
  --section-padding: 120px;
  --container-width: 1200px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent-primary);
  color: white;
}

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

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

ul, ol {
  list-style: none;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition-base);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
}

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

.nav-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  display: flex;
  gap: 4px;
}

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

.nav-menu {
  display: flex;
  gap: 40px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: var(--transition-base);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 70%);
  bottom: -150px;
  left: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--academic-color) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.2;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
  animation: fadeInDown 0.8s ease forwards;
}

.badge-icon {
  font-size: 18px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 10vw, 100px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.title-line {
  display: block;
  background: linear-gradient(135deg, #fff 0%, #a0a0b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--accent-primary);
  margin-bottom: 24px;
  min-height: 32px;
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-description {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 40px;
  line-height: 1.8;
  animation: fadeInUp 0.8s ease 0.6s forwards;
  opacity: 0;
}

.highlight {
  color: var(--text-primary);
  font-weight: 600;
  position: relative;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0.6;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 50px;
  animation: fadeInUp 0.8s ease 0.8s forwards;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 50px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}

.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
}

.hero-social {
  display: flex;
  justify-content: center;
  gap: 20px;
  animation: fadeInUp 0.8s ease 1s forwards;
  opacity: 0;
}

.hero-social a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition-base);
}

.hero-social a:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-3px);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
  animation: fadeIn 1s ease 1.5s forwards;
  opacity: 0;
}

.mouse {
  width: 24px;
  height: 40px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  position: relative;
}

.wheel {
  width: 4px;
  height: 8px;
  background: var(--text-muted);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll 2s ease infinite;
}

@keyframes scroll {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(16px); }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

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

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

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about {
  padding: var(--section-padding) 0;
  background: var(--bg-secondary);
}

.about-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 80px;
  align-items: start;
}

.about-image {
  position: sticky;
  top: 120px;
  width: 100%;
}

.image-wrapper {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.image-wrapper img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}

.image-decoration {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--bg-secondary) 100%);
}

.about-cta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.about-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
  padding: 16px 28px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  transition: var(--transition-base);
  box-shadow: var(--shadow-glow);
}

.about-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 30px var(--accent-glow);
}

.about-btn-primary i {
  font-size: 18px;
}

.about-btn-group {
  display: flex;
  gap: 10px;
}

.about-btn-group .about-btn {
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

.about-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-base);
}

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

.about-btn i {
  font-size: 16px;
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.about-track {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  transition: var(--transition-base);
}

.about-track:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.track-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.track-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.track-icon.academic {
  background: rgba(34, 211, 238, 0.15);
  color: var(--academic-color);
}

.track-icon.industry {
  background: rgba(244, 114, 182, 0.15);
  color: var(--industry-color);
}

.track-header h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.about-track p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-track p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.research-tags,
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--academic-color);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.tech {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(244, 114, 182, 0.1);
  color: var(--industry-color);
  border: 1px solid rgba(244, 114, 182, 0.2);
}

/* ============================================
   SKILLS SECTION
   ============================================ */
.skills {
  padding: var(--section-padding) 0;
  background: var(--bg-primary);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 28px;
  transition: var(--transition-base);
}

.skill-category:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.category-header i {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.category-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  transition: var(--transition-fast);
}

.skill-tag:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* ============================================
   CERTIFICATIONS (Inside Skills)
   ============================================ */
.section-divider {
  margin: 60px 0 32px;
  text-align: center;
  position: relative;
}

.section-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
  z-index: 0;
}

.subsection-title {
  display: inline-block;
  background: var(--bg-primary);
  padding: 0 24px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3-Column Layout */
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.cert-card {
  position: relative;
  display: flex;
  flex-direction: column; /* Vertical layout for 3 columns */
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  transition: var(--transition-base);
  overflow: hidden;
  text-decoration: none;
  height: 100%;
}

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

.cert-icon-wrapper {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
  padding: 8px;
}

.cert-icon-wrapper i {
  font-size: 28px;
  color: var(--accent-primary);
}

.cert-icon-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cert-card:hover .cert-icon-wrapper {
  background: var(--bg-primary);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.cert-content {
  flex: 1;
  z-index: 1;
  width: 100%;
}

.cert-content h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  line-height: 1.4;
  min-height: 44px; /* Align titles */
}

.cert-issuer {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.cert-verify {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--accent-primary);
  font-weight: 500;
  opacity: 0.8;
  transition: var(--transition-fast);
  margin-top: auto;
}

.cert-card:hover .cert-verify {
  opacity: 1;
  gap: 12px;
}

.cert-bg-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle at top right, var(--accent-glow), transparent 70%);
  opacity: 0;
  transition: var(--transition-slow);
}

.cert-card:hover .cert-bg-glow {
  opacity: 1;
}

/* ============================================
   EXPERIENCE SECTION
   ============================================ */
.experience {
  padding: var(--section-padding) 0;
  background: var(--bg-secondary);
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

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

.timeline-item {
  position: relative;
  padding-left: 70px;
  padding-bottom: 40px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: 15px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid;
  background: var(--bg-secondary);
  z-index: 1;
}

.timeline-marker.work {
  border-color: var(--industry-color);
}

.timeline-marker.education {
  border-color: var(--academic-color);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: var(--transition-base);
  position: relative;
}

.timeline-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.timeline-badge.startup {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.timeline-content:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.timeline-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.company-logo {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: contain;
  background: white;
  padding: 6px;
}

.timeline-info h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-info h4 {
  font-size: 14px;
  color: var(--accent-primary);
  margin-bottom: 6px;
}

.timeline-info h4 a:hover {
  text-decoration: underline;
}

.timeline-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.timeline-meta i {
  margin-right: 6px;
}

.timeline-details {
  padding-left: 20px;
}

.timeline-details li {
  position: relative;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.timeline-details li::before {
  content: '▹';
  position: absolute;
  left: -20px;
  color: var(--accent-primary);
}

.publication-link {
  color: var(--academic-color);
}

.publication-link:hover {
  text-decoration: underline;
}

/* ============================================
   PORTFOLIO SECTION
   ============================================ */
.portfolio {
  padding: var(--section-padding) 0;
  background: var(--bg-secondary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  aspect-ratio: 16/10;
  cursor: pointer;
  transition: var(--transition-base);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-primary);
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.project-card:hover .project-image {
  transform: scale(1.05);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(10, 10, 15, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: var(--transition-base);
}

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

.project-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.project-caption {
  color: var(--accent-primary);
  font-size: 14px;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.project-btn i {
  transition: var(--transition-fast);
}

.project-btn:hover i {
  transform: translateX(4px);
}

/* ============================================
   BLOG SECTION
   ============================================ */
.blog {
  padding: var(--section-padding) 0;
  background: var(--bg-primary);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

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

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-base);
}

.blog-card:hover::before {
  transform: scaleX(1);
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
}

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

.blog-tag {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
}

.blog-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 16px;
  min-height: 56px; /* Ensure alignment */
}

.blog-title a {
  color: var(--text-primary);
  background: linear-gradient(to right, var(--text-primary) 0%, var(--text-primary) 100%);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.3s;
}

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

.blog-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 24px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0.8;
  transition: var(--transition-fast);
}

.blog-link:hover {
  opacity: 1;
  color: var(--accent-primary);
}

.blog-link i {
  font-size: 16px;
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

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

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  transform: translateY(20px);
  transition: var(--transition-base);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.modal-body {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-slider {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-primary);
}

.modal-slider img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.slider-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}

.slider-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  pointer-events: all;
  transition: var(--transition-fast);
}

.slider-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.modal-info {
  padding: 28px;
}

.modal-info h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-date {
  color: var(--accent-primary);
  font-size: 14px;
  margin-bottom: 16px;
}

.modal-description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
  background: var(--bg-primary); /* Changed to primary */
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
}

.contact-info {
  padding: 80px 60px;
}

.contact-description {
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 40px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-item i {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 18px;
}

.contact-item .label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.contact-item a,
.contact-item span {
  color: var(--text-primary);
  font-size: 15px;
}

.contact-item a:hover {
  color: var(--accent-primary);
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition-base);
}

.social-link:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: translateY(-3px);
}

.contact-map {
  background: var(--bg-primary);
  position: relative;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  border: none;
  filter: grayscale(1) invert(1);
  opacity: 0.7;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 400px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
}

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

.footer-content p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 4px;
}

.footer-tagline {
  font-family: var(--font-mono);
  font-size: 12px !important;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  :root {
    --section-padding: 80px;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .about-image {
    position: static;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cert-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
  }
  
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  
  .contact-map {
    min-height: 400px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
  }
  
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 100px 40px;
    gap: 24px;
    transition: var(--transition-base);
    border-left: 1px solid var(--border-color);
  }
  
  .nav-menu.active {
    right: 0;
  }
  
  .nav-toggle {
    display: flex;
    z-index: 1001;
  }
  
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
  
  .about-btn-group {
    flex-wrap: wrap;
  }
  
  .about-btn-group .about-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 120px;
  }
  
  .timeline::before {
    left: 14px;
  }
  
  .timeline-item {
    padding-left: 50px;
  }
  
  .timeline-marker {
    left: 5px;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
  }
  
  .cert-grid {
    grid-template-columns: 1fr; /* 1 column on mobile */
  }
  
  .cert-card {
    padding: 24px;
  }
  
  .blog-card {
    padding: 24px;
  }
  
  .contact-info {
    padding: 60px 24px;
  }
}

@media (max-width: 480px) {
  .hero-description {
    font-size: 16px;
  }
  
  .hero-badge {
    font-size: 12px;
    padding: 8px 14px;
  }
  
  .hero-badge span:last-child {
    display: none;
  }
  
  .hero-badge::after {
    content: "UPenn AI";
  }
  
  .scroll-indicator {
    display: none;
  }
  
  .about-btn-group {
    flex-direction: column;
  }
  
  .about-btn-group .about-btn {
    width: 100%;
  }
  
  .skill-tags {
    justify-content: center;
  }
  
  .timeline-header {
    flex-direction: column;
  }
  
  .company-logo {
    width: 60px;
    height: 60px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
