/* Base reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: #f8fafc;
  background: linear-gradient(180deg, #0a0d18 0%, #060812 50%, #0a0d18 100%);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

:root {
  --bg-primary: #04060e;
  --bg-secondary: #0a0d18;
  --bg-tertiary: #0f1419;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --primary: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --primary-solid: #8b5cf6;
  --primary-hover: #7c3aed;
  --accent: #06b6d4;
  --accent-bright: #0891b2;
  --success: #10b981;
  --warning: #f59e0b;
  --card-bg: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(15, 20, 25, 0.8);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --border-radius: 16px;
  --border-radius-lg: 24px;
}

/* Canvas background */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(140%) blur(16px);
  background: var(--glass);
  border-bottom: 1px solid var(--card-border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 32px;
}
.logo {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  background: var(--primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 300ms ease;
}
.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 500;
  position: relative;
  transition: all 300ms ease;
}
.nav-links a:hover { 
  color: var(--text-primary); 
  background: var(--card-hover);
  transform: translateY(-1px);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-solid);
  transition: all 300ms ease;
  transform: translateX(-50%);
}
.nav-links a:hover::after {
  width: 20px;
}

.nav-toggle { display: none; }

/* Sections */
.section { 
  padding: 120px 32px; 
  position: relative;
}
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  position: relative;
}

.hero {
  min-height: calc(100dvh - 80px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 60px 32px;
}
.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}
.hero-title {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 800;
  margin: 0 0 24px;
  line-height: 1.1;
  letter-spacing: -2px;
}
.hero-title .fade-line {
  display: block;
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0;
}
.hero-title .name { 
  background: var(--primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  position: relative;
}
.hero-title .name::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 60px;
  height: 4px;
  background: var(--primary-solid);
  transform: translateX(-50%);
  border-radius: 2px;
  box-shadow: var(--shadow-glow);
}
.hero-sub { 
  color: var(--text-secondary); 
  margin: 0 0 16px; 
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 400;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}
.hero-tag { 
  color: var(--text-muted); 
  margin-bottom: 40px;
  font-size: 16px;
}
.hero .cta { 
  display: inline-flex; 
  gap: 16px; 
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 600ms ease;
}
.btn:hover::before {
  transform: translateX(100%);
}
.btn:hover { 
  transform: translateY(-2px) scale(1.02); 
  border-color: var(--card-border);
  box-shadow: var(--shadow-lg);
}
.btn.primary { 
  background: var(--primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-glow), var(--shadow-md);
}
.btn.primary:hover {
  box-shadow: 0 0 60px rgba(139, 92, 246, 0.25), var(--shadow-lg);
}

.scroll-indicator { 
  margin-top: 60px; 
  font-size: 14px; 
  color: var(--text-subtle); 
  opacity: 0.8;
  position: relative;
  animation: bounce 2s infinite;
}
.scroll-indicator::after {
  content: '↓';
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
  60% { transform: translateY(-2px); }
}

.section-title {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 700;
  margin: 0 0 32px;
  color: var(--text-primary);
  position: relative;
  text-align: center;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 40px;
  height: 3px;
  background: var(--accent);
  transform: translateX(-50%);
  border-radius: 2px;
}
.lead { 
  color: var(--text-secondary); 
  max-width: 700px; 
  margin: 0 auto 48px;
  font-size: 18px;
  line-height: 1.7;
  text-align: center;
}

.stack {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  list-style: none;
  padding: 0;
  margin-top: 40px;
}
.stack li {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 24px 20px;
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  position: relative;
  transition: all 300ms ease;
  backdrop-filter: blur(8px);
}
.stack li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  opacity: 0;
  transition: opacity 300ms ease;
}
.stack li:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: var(--primary-solid);
  box-shadow: var(--shadow-md);
}
.stack li:hover::before {
  opacity: 1;
}

/* Enhanced About Section */
.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 60px;
  align-items: start;
  margin-top: 48px;
}

.about-details {
  display: grid;
  gap: 32px;
  margin-top: 40px;
}

.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 28px 24px;
  border-radius: var(--border-radius);
  transition: all 300ms ease;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.detail-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.05), transparent);
  transition: left 600ms ease;
}

.detail-card:hover::before {
  left: 100%;
}

.detail-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-solid);
  background: var(--card-hover);
  box-shadow: var(--shadow-md);
}

.detail-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: block;
}

.detail-card h3 {
  margin: 0 0 12px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 14px;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: sticky;
  top: 120px;
}

.stat-item {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 32px 24px;
  border-radius: var(--border-radius-lg);
  transition: all 300ms ease;
  backdrop-filter: blur(8px);
  position: relative;
}

.stat-item:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--primary-solid);
  box-shadow: var(--shadow-md);
  background: var(--card-hover);
}

.stat-number {
  display: block;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-solid);
  margin-bottom: 8px;
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Enhanced Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 48px;
}

.skill-category {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 32px 28px;
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(8px);
  transition: all 300ms ease;
  position: relative;
}

.skill-category:hover {
  transform: translateY(-4px);
  border-color: var(--primary-solid);
  box-shadow: var(--shadow-md);
  background: var(--card-hover);
}

.category-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.category-icon {
  font-size: 24px;
}

.skill-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.skill-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.skill-progress {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0;
  transition: width 1.5s ease-in-out;
  position: relative;
}

.skill-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Experience Timeline */
.experience-timeline {
  position: relative;
  margin-top: 48px;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-solid), var(--accent));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 48px;
}

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

.timeline-marker {
  position: absolute;
  left: 16px;
  top: 8px;
  width: 16px;
  height: 16px;
  background: var(--primary-solid);
  border: 3px solid var(--bg-primary);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  z-index: 1;
}

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 32px 28px;
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(8px);
  transition: all 300ms ease;
  position: relative;
  overflow: hidden;
}

.timeline-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.05), transparent);
  transition: left 600ms ease;
}

.timeline-content:hover::before {
  left: 100%;
}

.timeline-content:hover {
  transform: translateY(-4px) translateX(8px);
  border-color: var(--primary-solid);
  box-shadow: var(--shadow-lg);
}

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

.timeline-header h3 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.company {
  font-weight: 600;
  color: var(--primary-solid);
  font-size: 16px;
  margin-right: 16px;
}

.period {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.timeline-description {
  margin: 0 0 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

.tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  transition: all 300ms ease;
}

.tag:hover {
  background: var(--primary-solid);
  color: white;
  border-color: var(--primary-solid);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 48px;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 32px 28px;
  border-radius: var(--border-radius-lg);
  transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
  transition: left 600ms ease;
}
.project-card:hover::before {
  left: 100%;
}
.project-card:hover { 
  transform: translateY(-8px) scale(1.02); 
  border-color: var(--primary-solid);
  background: var(--card-hover);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(139, 92, 246, 0.15);
}
.project-card h3 {
  margin: 0 0 16px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.project-card p {
  margin: 0 0 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.project-card .link {
  font-weight: 600;
  transition: all 300ms ease;
  position: relative;
}
.project-card .link::after {
  content: '→';
  margin-left: 8px;
  transition: transform 300ms ease;
}
.project-card .link:hover::after {
  transform: translateX(4px);
}

.contact-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  list-style: none;
  padding: 0;
  margin-top: 48px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.contact-list li {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius-lg);
  padding: 0;
  transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.contact-list li::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.1), transparent);
  transition: left 600ms ease;
}

.contact-list li:hover::before {
  left: 100%;
}

.contact-list li:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(6, 182, 212, 0.15);
  background: var(--card-hover);
}

.contact-list .link { 
  color: var(--text-primary); 
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  font-weight: 600;
  font-size: 18px;
  transition: all 300ms ease;
  position: relative;
  min-height: 80px;
}

.contact-list .link:hover { 
  color: var(--accent);
}

.contact-list .link::after {
  content: '→';
  opacity: 0;
  transform: translateX(-10px);
  transition: all 300ms ease;
  font-size: 20px;
}

.contact-list .link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Add icons for different contact methods */
.contact-list .link[href^="mailto"]::before {
  content: '✉️';
  font-size: 24px;
  margin-right: -12px;
}

.contact-list .link[href*="github"]::before {
  content: '🐱';
  font-size: 24px;
  margin-right: -12px;
}

.contact-list .link[href*="linkedin"]::before {
  content: '💼';
  font-size: 24px;
  margin-right: -12px;
}

.contact-list .link[href*="twitter"]::before,
.contact-list .link[href*="x.com"]::before {
  content: '🐦';
  font-size: 24px;
  margin-right: -12px;
}

/* Enhanced contact section */
.contact .container {
  text-align: center;
}

.contact .section-title::after {
  background: var(--accent);
}

.site-footer { 
  border-top: 1px solid var(--card-border); 
  padding: 40px 32px; 
  margin-top: 80px; 
  background: var(--glass);
  backdrop-filter: blur(16px);
}
.site-footer .container { 
  display: flex; 
  justify-content: center;
  color: var(--text-muted);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .section { padding: 80px 20px; }
  .nav { padding: 16px 20px; }
  .nav-toggle { 
    display: inline-flex; 
    background: var(--card-bg); 
    border: 1px solid var(--card-border); 
    color: var(--text-primary); 
    padding: 8px 12px; 
    border-radius: 8px;
    backdrop-filter: blur(8px);
  }
  .nav-links { 
    position: absolute; 
    right: 20px; 
    top: 70px; 
    background: var(--glass); 
    border: 1px solid var(--card-border); 
    border-radius: var(--border-radius); 
    padding: 16px; 
    display: none; 
    flex-direction: column;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { margin: 4px 0; }
  
  .hero { padding: 40px 20px; }
  .hero-title { font-size: clamp(36px, 8vw, 64px); }
  .hero .cta { flex-direction: column; align-items: center; }
  
  .stack { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; gap: 24px; }
  .contact-list { 
    grid-template-columns: 1fr; 
    gap: 20px; 
    max-width: 400px;
  }
  .contact-list .link {
    padding: 24px 20px;
    font-size: 16px;
    min-height: 60px;
  }
  
  /* Mobile responsive for new sections */
  .about-content { 
    grid-template-columns: 1fr; 
    gap: 40px; 
  }
  .about-stats { 
    position: static; 
    flex-direction: row; 
    justify-content: space-around;
    gap: 16px;
  }
  .stat-item { 
    padding: 20px 16px; 
    flex: 1;
  }
  .stat-number { 
    font-size: 28px; 
  }
  
  .skills-grid { 
    grid-template-columns: 1fr; 
    gap: 24px; 
  }
  .skill-category { 
    padding: 24px 20px; 
  }
  
  .experience-timeline::before { 
    left: 16px; 
  }
  .timeline-item { 
    padding-left: 44px; 
  }
  .timeline-marker { 
    left: 8px; 
    width: 12px; 
    height: 12px; 
  }
  .timeline-content { 
    padding: 24px 20px; 
  }
  .timeline-tags { 
    gap: 6px; 
  }
  .tag { 
    font-size: 11px; 
    padding: 3px 10px; 
  }
}

a {
    color: var(--warning);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}