/* Modern Reset & Variables */
:root {
  /* Light Mode (Default) */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --bg-body: #ffffff;
  --bg-alt: #f3f4f6;
  --bg-card: #ffffff;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Gradients */
  --hero-gradient: linear-gradient(to bottom right, #f0f9ff, #e0f2fe);
  --text-gradient: linear-gradient(to right, var(--primary-color), #4f46e5);

  /* Card Specifics for contrast */
  --card-bg-contrast: #ffffff;
  --card-border-contrast: #e5e7eb;

  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  /* Dark Mode Overrides */
  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --bg-body: #111827;
  --bg-alt: #1f2937;
  --bg-card: #1f2937;
  --border-color: #374151;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.2);

  /* Gradients */
  --hero-gradient: linear-gradient(to bottom right, #111827, #1e3a8a);
  --text-gradient: linear-gradient(to right, var(--primary-color), #a78bfa);

  /* Card Specifics for contrast */
  --card-bg-contrast: #374151;
  /* Lighter gray for dark mode contrast */
  --card-border-contrast: #4b5563;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

ul {
  list-style: none;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3rem;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.5);
  /* Blue shadow */
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.6);
  filter: brightness(1.1);
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-body);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background-color 0.3s, border-color 0.3s;
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

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

.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
}

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

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.25rem;
  color: var(--text-main);
  transition: color 0.2s;
  margin-left: 1rem;
  display: flex;
  align-items: center;
}

.theme-toggle:hover {
  color: var(--primary-color);
}


/* Hero Section */
.hero {
  padding-top: 8rem;
  padding-bottom: 5rem;
  background: var(--hero-gradient);
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text {
  flex: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: var(--text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-img-wrapper {
  position: relative;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transition: border-color 0.3s;
}

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

/* About Section */
.about {
  background-color: var(--bg-body);
}

.experience-list {
  max-width: 800px;
  margin: 0 auto;
}

.experience-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: var(--bg-alt);
  border-radius: 1rem;
  transition: transform 0.2s, background-color 0.3s;
}

.experience-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.exp-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
}

/* Skills Section */
.skills {
  background-color: var(--bg-alt);
  transition: background-color 0.3s;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.skill-card {
  background: var(--card-bg-contrast);
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  border: 1px solid var(--card-border-contrast);
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Specific icon adjustments for dark mode */
[data-theme="dark"] .skill-icon[src*="express"] {
  filter: invert(1) brightness(2);
}

[data-theme="dark"] .skill-icon[src*="linux"] {
  filter: invert(1);
}

[data-theme="dark"] .skill-icon[src*="aws"] {
  filter: invert(1);
}

.skill-icon {
  height: 80px;
  margin: 0 auto 1.5rem auto;
  /* Center horizontally */
  object-fit: contain;
}

.skill-name {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.skill-years {
  color: var(--text-muted);
  font-size: 0.9rem;
  background-color: var(--bg-alt);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  display: inline-block;
}

/* Projects Section */
.projects {
  background-color: var(--bg-body);
}

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

.project-card {
  background: var(--bg-card);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.project-img {
  height: 200px;
  width: 100%;
  object-fit: cover;
  object-position: top;
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.project-link {
  color: var(--primary-color);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Blogs Section */
.blogs {
  background-color: var(--bg-alt);
  transition: background-color 0.3s;
}

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

.blog-card {
  background: var(--card-bg-contrast);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  height: 100%;
  border: 1px solid var(--card-border-contrast);
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.blog-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.blog-preview {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Footer */
.footer {
  background-color: #111827;
  color: white;
  padding: 4rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.footer-contact p {
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

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

.social-link {
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  transition: background-color 0.2s;
}

.social-link:hover {
  background-color: var(--primary-color);
}

/* Responsive */
.nav-controls {
  display: flex;
  align-items: center;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
  margin-right: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    /* Hide by default on mobile */
  }

  .nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 4rem;
    left: 0;
    width: 100%;
    background-color: var(--bg-body);
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links a {
    display: block;
    margin-bottom: 1rem;
    font-size: 1.1rem;
  }

  .nav-logo {
    font-size: 1.2rem;
    /* Reduced from 1.5rem */
  }

  /* Make sure theme toggle is nicely positioned in mobile menu */
  .theme-toggle {
    margin-left: 0;
    margin-top: 1rem;
  }

  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-img-wrapper {
    width: 250px;
    height: 250px;
  }

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

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