:root {
  /* Default Light Theme */
  --bg-color: #ffffff;
  --bg-secondary: #f9fafb;
  /* Gray 50 */

  --text-primary: #111827;
  /* Gray 900 */
  --text-secondary: #4b5563;
  /* Gray 600 */
  --text-tertiary: #9ca3af;
  /* Gray 400 */

  --accent-color: #2563eb;
  /* Blue 600 */
  --accent-secondary: #7c3aed;
  /* Violet 600 */
  --accent-glow: rgba(37, 99, 235, 0.15);
  /* Subtle Blue Glow */

  --border-color: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.2);

  --card-bg: #ffffff;
  --card-hover: #f3f4f6;
  /* Gray 100 */

  /* Typography */
  --font-primary: 'Inter', sans-serif;

  /* Spacing */
  --spacing-sm: 0.5rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 3rem;
  --spacing-xl: 6rem;

  /* Layout */
  --container-width: 1100px;

  /* Theme Toggle Icon */
  --icon-fill: #111827;
}

[data-theme="dark"] {
  /* Cyberpunk / Modern Dark */
  --bg-color: #050505;
  --bg-secondary: #0a0a0a;

  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-tertiary: #525252;

  --accent-color: #3b82f6;
  /* Bright Blue */
  --accent-secondary: #8b5cf6;
  /* Violet */
  --accent-glow: rgba(59, 130, 246, 0.4);

  --border-color: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(255, 255, 255, 0.2);

  --card-bg: rgba(255, 255, 255, 0.03);
  --card-hover: rgba(255, 255, 255, 0.06);

  --icon-fill: #ffffff;
}



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

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

body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 15% 50%, var(--accent-glow), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
  width: 100%;
}

/* ... existing code ... */

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
    /* Reduced from 3rem to prevent overflow */
  }

  .container {
    padding: 0 1.5rem;
    /* Reduced padding */
  }

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

  /* Fix for horizontal scroll on small screens: reduce min width of cards */
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

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

  /* Timeline adjustments for mobile */
  .timeline {
    margin-left: 0;
    padding-left: 2rem;
  }

  .timeline-item::before {
    left: -2rem;
  }

  .timeline-item::after {
    left: -2.35rem;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    /* This uses variable, so OK */
    padding: 2rem;
    height: 100vh;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links.active a {
    font-size: 1.5rem;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  .hero-cta-group {
    width: 100%;
  }

  /* Keep social buttons from stretching too wide if not needed, or let them sit together */
  .social-btn {
    flex: 0 0 auto;
    /* Don't grow too much */
  }
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: var(--card-hover);
  border-color: var(--text-primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
}

/* Hide/Show icons based on theme */
.theme-toggle .moon-icon {
  display: none;
}

.theme-toggle .sun-icon {
  display: block;
}

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

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

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

/* Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--spacing-xl) 0;
}

.section-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  /* Light mode default */
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  transition: background 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .navbar {
  background: rgba(5, 5, 5, 0.8);
}

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

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 6px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: 0.3s;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  padding-top: 140px;
  position: relative;
}

.hero-content {
  max-width: 900px;
}

.eyebrow {
  display: inline-block;
  color: var(--accent-color);
  font-weight: 500;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
  background: linear-gradient(to right, #111827, #4b5563);
  /* Light mode gradient */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .hero h1 {
  background: linear-gradient(to right, #fff, #a3a3a3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hero-cta-group {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-social-group {
  display: flex;
  gap: 1rem;
}

.btn-primary {
  padding: 1rem 2rem;
  background: var(--accent-color);
  color: #ffffff;
  font-weight: 600;
  border-radius: 4px;
}

.btn-primary:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
}

.btn-secondary {
  padding: 1rem 2rem;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
  border-radius: 4px;
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* About Section */
.about-grid {
  display: block;
  max-width: 800px;
}

.about-text p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.8;
}

.stat-item {
  border-left: 2px solid var(--border-color);
  padding-left: 1.5rem;
  margin-bottom: 2rem;
}

.stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.skill-category {
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: 0.3s;
}

.skill-category:hover {
  border-color: var(--border-hover);
  background: var(--card-hover);
}

.skill-category h3 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.skill-tags span {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: 0.2s;
}

.skill-tags span:hover {
  color: var(--text-primary);
  border-color: var(--accent-color);
  background: var(--card-hover);
}

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

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-color);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.project-content {
  padding: 2.5rem;
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.project-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.project-tags span {
  color: var(--accent-color);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Experience Timeline */
.timeline {
  border-left: 1px solid var(--border-color);
  margin-left: 1rem;
  padding-left: 3rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 4rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 0.5rem;
  width: 1rem;
  height: 1px;
  background: var(--border-color);
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -3.35rem;
  /* Adjustable based on dot size */
  top: 0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-color);
}

.timeline-date {
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.timeline-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.timeline-content .company {
  color: var(--text-tertiary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Contact */
.contact-section {
  text-align: center;
  /* Exception: Contact can be centered for focus */
  padding: 8rem 0;
}

.contact-subtitle {
  color: var(--text-secondary);
  font-size: 1.5rem;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.contact-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
}

.contact-btn:hover {
  background: var(--text-primary);
  color: var(--bg-color);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 4rem 0 0;
  color: var(--text-secondary);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 3rem;
  max-width: 600px;
  margin: 0 auto;
}

.footer-col h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.footer-col p {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.social-links a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: 0.3s;
}

.social-links a:hover {
  background: var(--accent-color);
  color: #ffffff;
  border-color: var(--accent-color);
  transform: translateY(-3px);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  background: var(--bg-color);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .footer-container {
    padding-bottom: 2rem;
  }
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
    /* Reduced to fit smaller screens */
  }

  .container {
    padding: 0 1.5rem;
    /* Reduce container padding on mobile */
  }

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

  .skills-grid {
    /* Reduce min-width constraint for cards on mobile to avoid overflow */
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

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

  /* Timeline responsiveness */
  .timeline {
    margin-left: 0.5rem;
    padding-left: 2rem;
  }

  .timeline-item::before {
    left: -2rem;
  }

  .timeline-item::after {
    left: -2.3rem;
  }

  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    /* This uses variable, so OK */
    padding: 2rem;
    height: 100vh;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links.active a {
    font-size: 1.5rem;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  /* Keep social buttons from stretching too wide if not needed, or let them sit together */
  .social-btn {
    flex: 0 0 auto;
    /* Don't grow too much */
  }
}

/* Timeline List Styling */
.timeline-content ul {
  list-style: none;
  margin-top: 1rem;
}

.timeline-content li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

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

.social-btn {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  /* Ensure square-ish */
}
