:root {
  --bg: #fafbff;
  --bg-alt: #f0f2fa;
  --text: #1a1a2e;
  --text-secondary: #5a607a;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.08);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --border: #e2e5f1;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-shadow: 0 2px 8px rgba(99, 102, 241, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 20px 40px rgba(99, 102, 241, 0.15), 0 8px 16px rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(250, 251, 255, 0.8);
  --tag-bg: rgba(99, 102, 241, 0.06);
  --tag-text: #4f46e5;
  --skeleton-bg: #e5e7eb;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --hero-bg: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, 0.12), transparent),
             radial-gradient(ellipse 60% 50% at 80% 50%, rgba(168, 85, 247, 0.08), transparent),
             radial-gradient(ellipse 50% 40% at 20% 60%, rgba(59, 130, 246, 0.06), transparent);
  --section-divider: linear-gradient(90deg, transparent, var(--border), transparent);
}

[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-alt: #111827;
  --text: #e2e8f0;
  --text-secondary: #8b93b0;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: rgba(129, 140, 248, 0.1);
  --accent-glow: rgba(129, 140, 248, 0.3);
  --accent-gradient: linear-gradient(135deg, #818cf8, #a78bfa, #c084fc);
  --border: #1e2740;
  --card-bg: rgba(17, 24, 39, 0.6);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
  --card-shadow-hover: 0 20px 40px rgba(129, 140, 248, 0.1), 0 8px 16px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(11, 15, 26, 0.8);
  --tag-bg: rgba(129, 140, 248, 0.1);
  --tag-text: #a5b4fc;
  --skeleton-bg: #1e293b;
  --hero-bg: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(129, 140, 248, 0.1), transparent),
             radial-gradient(ellipse 60% 50% at 80% 50%, rgba(167, 139, 250, 0.06), transparent),
             radial-gradient(ellipse 50% 40% at 20% 60%, rgba(96, 165, 250, 0.04), transparent);
  --section-divider: linear-gradient(90deg, transparent, var(--border), transparent);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s ease, color 0.3s ease;
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navigation */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .nav.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

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

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  padding: 6px 14px;
  border-radius: 8px;
}

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

#nav-resume-link {
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  font-weight: 600;
}

#nav-resume-link:hover {
  background: var(--accent);
  color: #fff;
}

.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  transition: all 0.25s;
}

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

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }

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

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.hero-bg-effects {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background: var(--hero-bg);
  pointer-events: none;
  z-index: -1;
  transition: background 0.4s ease;
}

.hero-content {
  max-width: 680px;
  position: relative;
}

.hero-with-image .hero-content {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 60px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-image {
  flex-shrink: 0;
  animation: fadeInUp 0.8s 0.3s ease forwards;
  opacity: 0;
}

.hero-image-wrapper {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--border);
  box-shadow: 0 0 0 8px var(--accent-light), 0 20px 40px var(--accent-glow);
  transition: all 0.4s ease;
  position: relative;
}

.hero-image-wrapper::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent-gradient);
  z-index: -1;
  opacity: 0.5;
}

.hero-image-wrapper:hover {
  transform: scale(1.03);
  box-shadow: 0 0 0 8px var(--accent-light), 0 24px 50px var(--accent-glow);
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease forwards;
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  font-family: var(--font-mono);
  margin-bottom: 8px;
  animation: fadeInUp 0.6s 0.1s ease forwards;
  opacity: 0;
}

.hero-name {
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  margin-bottom: 14px;
  letter-spacing: -0.03em;
  animation: fadeInUp 0.6s 0.2s ease forwards;
  opacity: 0;
}

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

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s 0.3s ease forwards;
  opacity: 0;
}

.hero-desc {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 36px;
  line-height: 1.75;
  animation: fadeInUp 0.6s 0.4s ease forwards;
  opacity: 0;
}

.hero-cta {
  display: flex;
  gap: 14px;
  margin-bottom: 44px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s 0.5s ease forwards;
  opacity: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  font-family: var(--font-sans);
  position: relative;
}

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

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

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

.btn-outline:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.1);
}

.hero-socials {
  display: flex;
  gap: 12px;
  animation: fadeInUp 0.6s 0.6s ease forwards;
  opacity: 0;
}

.hero-socials a {
  color: var(--text-secondary);
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
}

.hero-socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px var(--accent-glow);
}

/* Section Styles */
.section {
  padding: 100px 0;
  position: relative;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  margin-bottom: 56px;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
}

.section-divider {
  width: 100%;
  height: 1px;
  background: var(--section-divider);
  border: none;
  margin: 0;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.about-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.85;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
  padding: 20px 16px;
  border-radius: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

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

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: var(--font-mono);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 4px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.skill-category {
  padding: 28px;
  border-radius: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.skill-category:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent);
}

.skill-category h3 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}

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

.skill-tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s;
  border: 1px solid transparent;
}

.skill-tag:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.project-card {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

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

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

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.project-card-icon {
  color: var(--accent);
}

.project-card-link {
  color: var(--text-secondary);
  transition: all 0.25s;
}

.project-card:hover .project-card-link {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex: 1;
  line-height: 1.65;
  margin-bottom: 20px;
}

.project-card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.project-card-footer span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.project-tech-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

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

/* Loading skeleton */
.loading-skeleton {
  display: contents;
}

.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--skeleton-bg), transparent);
  animation: shimmer 1.5s infinite;
}

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

/* Timeline */
.timeline {
  position: relative;
  padding-left: 40px;
}

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

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

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

.timeline-marker {
  position: absolute;
  left: -40px;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 3px var(--accent), 0 0 12px var(--accent-glow);
  transition: box-shadow 0.3s;
}

.section-alt .timeline-marker {
  border-color: var(--bg-alt);
}

.timeline-item:hover .timeline-marker {
  box-shadow: 0 0 0 3px var(--accent), 0 0 20px var(--accent-glow);
}

.timeline-card {
  padding: 24px;
  border-radius: 16px;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

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

.timeline-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.timeline-company {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}

.timeline-date {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  margin: 8px 0 14px;
  padding: 3px 10px;
  background: var(--accent-light);
  border-radius: 6px;
  font-weight: 500;
}

.timeline-content p {
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.75;
}

/* Contact */
.contact-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-links .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.contact-links .btn svg {
  width: 20px;
  height: 20px;
}

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer .heart {
  color: #ef4444;
  display: inline-block;
  animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-hamburger {
    display: flex;
  }

  .hero {
    padding-top: 100px;
    min-height: auto;
    padding-bottom: 60px;
  }

  .hero-with-image .hero-content {
    flex-direction: column-reverse;
    gap: 32px;
    text-align: center;
  }

  .hero-with-image .hero-socials,
  .hero-with-image .hero-cta,
  .hero-with-image .hero-badge {
    justify-content: center;
  }

  .hero-image-wrapper {
    width: 180px;
    height: 180px;
  }

  .hero-name {
    font-size: 2.4rem;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .stat {
    padding: 14px 8px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 70px 0;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline-marker {
    left: -32px;
  }

  .timeline-card {
    padding: 18px;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

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

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