:root {
  --bg-color: #000000;
  --surface-color: #111111;
  --surface-border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --accent-color: #3b82f6;
  --gradient-1: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --glass-bg: rgba(20, 20, 20, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Background animation */
.bg-nodes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 20% 40%, rgba(59, 130, 246, 0.05), transparent 30%),
    radial-gradient(circle at 80% 60%, rgba(139, 92, 246, 0.05), transparent 30%);
}

.node {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  animation: float 20s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

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

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.2;
}

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

/* Status Widget */
.status-widget {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  font-size: 13px;
  font-family: var(--font-mono);
  margin-bottom: 32px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Hero Section */
.hero {
  padding: 120px 24px 80px;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 40px;
}

.hero-content {
  flex: 1;
}

.hero-image-wrapper {
  flex-shrink: 0;
  position: relative;
  width: 230px; 
  height: 230px;
  border-radius: 24px;
  background: var(--gradient-1);
  padding: 3px;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
  animation: floatProfile 6s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.hero-image-wrapper:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.4);
  animation-play-state: paused;
}

.profile-image {
  width: 100%; 
  height: 100%;
  object-fit: cover;
  border-radius: 21px; /* Slightly less than wrapper to fit inside padding */
  display: block;
}

@keyframes floatProfile {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0px); }
}

.terminal-text {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 16px;
}

.terminal-text span:first-child {
  color: #10b981;
}

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

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

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.hero h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 24px;
  font-weight: 500;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin-bottom: 40px;
}

/* Buttons */
.cta-group {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
}

.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: var(--text-primary);
  color: var(--bg-color);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.btn.primary:hover {
  background: #e5e7eb;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.4);
}

.btn.primary:active {
  transform: translateY(0) scale(0.95);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn.secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(10px);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px) scale(1.02);
}

.btn.secondary:active {
  transform: translateY(0) scale(0.95);
  transition: transform 0.1s ease;
}

/* Code Window */
.code-window {
  background: #0d0d0d;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-width: 700px;
}

.window-header {
  background: #1a1a1a;
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--surface-border);
}

.window-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ef4444;
}

.dot.yellow {
  background: #f59e0b;
}

.dot.green {
  background: #10b981;
}

.code-window pre {
  padding: 24px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #a78bfa;
  overflow-x: auto;
}

.code-window pre .string {
  color: #a5d6ff;
}

.code-window pre .key {
  color: #7ee787;
}

.code-window pre .punctuation {
  color: #8b949e;
}

/* Sections */
section {
  padding: 120px 24px 60px;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 40px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-title::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--surface-border);
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* About / Skills Grid */
.bio-full {
  max-width: 800px;
  margin-bottom: 60px;
}

.bio-full p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
}

.subsection-title {
  font-size: 1.25rem;
  margin-bottom: 24px;
  margin-top: 40px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.skill-category {
  padding: 24px;
}

.skill-category h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.skill-category .tags,
.learning-tags,
.interests-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-highlight {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.05) 0%, rgba(20, 20, 20, 0.4) 100%);
}

.ai-highlight h4 {
  color: #a78bfa;
}

.badge {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.badge.expert {
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

.badge.advanced {
  border-color: rgba(59, 130, 246, 0.4);
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.badge.learning {
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
  border-style: dashed;
}

.badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.badge.interest {
  border-color: rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
  background: rgba(167, 139, 250, 0.03);
}

.badge.interest:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.6);
  color: #ddd6fe;
}

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

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

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

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 32px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color);
}

.timeline-item .glass-card {
  padding: 24px 32px;
}

.timeline-item h3 {
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.timeline-item h4 {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 8px;
}

.timeline-item .date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a78bfa;
  display: block;
  margin-bottom: 16px;
}

.timeline-item p {
  color: var(--text-secondary);
  font-size: 14px;
}

.timeline-item ul {
  list-style-type: none;
  padding-left: 0;
  margin-top: 12px;
}

.timeline-item li {
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.timeline-item li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

.timeline-item li strong {
  color: var(--text-primary);
}

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

.project-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.project-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.project-card .btn-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: gap 0.2s ease, color 0.2s ease;
}

.project-card .btn-link:hover {
  gap: 12px;
  color: var(--accent-color);
}

/* Education */
#education, #experience, #expertise {
  margin-top: 40px;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.edu-card h3 {
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.edu-card h4 {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 12px;
}

.edu-card span {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8b5cf6;
}

/* Contact / Footer */
.footer {
  padding: 100px 24px 60px;
  text-align: center;
  border-top: 1px solid var(--surface-border);
  margin-top: 40px;
}

.footer h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 32px;
}

.footer .social-links {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer .social-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 14px;
  transition: color 0.2s ease;
  text-transform: lowercase;
}

.footer .social-links a:hover {
  color: var(--text-primary);
}

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

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

.scroll-top-btn:hover {
  background: var(--accent-color);
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Mobile */
@media (max-width: 768px) {
  .hero-split {
    flex-direction: column-reverse;
    text-align: left;
    gap: 40px;
  }
  .hero-image-wrapper {
    width: 220px;
    height: 220px;
    margin: 0 auto;
  }

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

  .cta-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .timeline::before {
    display: none;
  }

  .timeline {
    padding-left: 0;
  }

  .timeline-dot {
    display: none;
  }
}

/* --- Theme Toggle --- */
.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  transform: scale(1.05);
  background: var(--glass-bg);
}

.sun-icon {
  display: none;
}

body.light-mode .sun-icon {
  display: block;
}

body.light-mode .moon-icon {
  display: none;
}

/* --- Light Mode Variables --- */
body.light-mode {
  --bg-color: #f9fafb;
  --surface-color: #ffffff;
  --surface-border: rgba(0, 0, 0, 0.1);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --glass-bg: rgba(255, 255, 255, 0.7);
}

body.light-mode .bg-nodes {
  background: radial-gradient(circle at 20% 40%, rgba(59, 130, 246, 0.08), transparent 30%),
    radial-gradient(circle at 80% 60%, rgba(139, 92, 246, 0.08), transparent 30%);
}

body.light-mode .node {
  background: rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

body.light-mode .code-window {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .timeline-item .date {
  color: #6d28d9;
}

body.light-mode .badge {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
}

body.light-mode .glass-card:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .btn.primary {
  background: var(--text-primary);
  color: #ffffff;
}

body.light-mode .btn.primary:hover {
  background: #1f2937;
}

/* --- Modal System --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 480px;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  padding: 40px;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s ease;
}

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

.modal-content h2 {
  margin-bottom: 8px;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 15px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item span {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}

.email-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-color);
  border: 1px solid var(--surface-border);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.email-box button {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.email-box button:hover {
  background: var(--text-primary);
  color: var(--bg-color);
}

.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.social-grid .btn.primary {
  grid-column: span 2;
}