/* Modern CSS Variables & Reset */
:root {
  /* Color Palette - Light Mode */
  --primary-color: #2d3436;
  --secondary-color: #636e72;
  --accent-color: #0984e3;
  --accent-hover: #74b9ff;
  --bg-color: #ffffff;
  --card-bg: #f8f9fa;
  --border-color: #e1e1e1;
  --text-color: #2d3436;
  --text-secondary: #636e72;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
  --gradient-text: linear-gradient(120deg, #2d3436, #0984e3);

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;

  /* Spacing */
  --container-width: 1200px;
  --header-height: 80px;
}

:root[data-theme="dark"] {
  /* Color Palette - Dark Mode */
  --primary-color: #f1f1f1;
  --secondary-color: #b2bec3;
  --accent-color: #74b9ff;
  --accent-hover: #0984e3;
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --border-color: #2d2d2d;
  --text-color: #f1f1f1;
  --text-secondary: #b2bec3;

  --gradient-text: linear-gradient(120deg, #f1f1f1, #74b9ff);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

ul {
  list-style: none;
}

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

/* Layout Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

:root[data-theme="dark"] header {
  background-color: rgba(18, 18, 18, 0.8);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
  transition: var(--transition-fast);
  text-decoration: none;
}

.logo:hover {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-link {
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 8px;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: var(--card-bg);
  color: var(--accent-color);
}

/* Hero Section */
.hero {
  padding-top: calc(var(--header-height) + 60px);
  padding-bottom: 60px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.hero-text h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 8s ease infinite;
}

.hero-text h2 {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-weight: 500;
}

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

.hero-cta {
  display: flex;
  gap: 20px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-color);
  border: 2px solid var(--border-color);
}

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

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

.profile-img-container {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--card-bg);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

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

.hero-blob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: var(--gradient-primary);
  filter: blur(60px);
  opacity: 0.2;
  z-index: 0;
  border-radius: 50%;
  animation: blobPulse 8s infinite alternate;
}

/* Skills Section */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 60px;
  position: relative;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

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

.skill-card {
  background-color: var(--card-bg);
  padding: 30px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
}

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

.skill-card h3 {
  font-size: 1.25rem;
  margin-bottom: 20px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.skill-tag {
  background-color: rgba(9, 132, 227, 0.1);
  color: var(--accent-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

:root[data-theme="dark"] .skill-tag {
  background-color: rgba(116, 185, 255, 0.15);
}

.skill-tag:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Portfolio Section */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.project-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.project-content {
  padding: 30px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

.project-role {
  font-size: 0.9rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 1rem;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 25px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.tech-pill {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background-color: rgba(0, 0, 0, 0.05);
  padding: 4px 10px;
  border-radius: 4px;
}

:root[data-theme="dark"] .tech-pill {
  background-color: rgba(255, 255, 255, 0.1);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 1rem;
}

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

/* Contact Section */
.contact-section {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.contact-text {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-weight: 600;
  color: var(--text-color);
  transition: var(--transition-normal);
}

.social-btn:hover {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

/* Animations */
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

@keyframes blobPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

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

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

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-btn span {
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 3px;
  transition: var(--transition-fast);
}

/* Responsive Design */
@media (max-width: 968px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 60px;
    justify-items: center;
    /* Ensure grid items are centered */
  }

  .hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center flex items */
  }

  .hero-text p {
    margin: 0 auto 40px;
  }

  .hero-cta {
    justify-content: center;
  }

  .hero-image {
    order: -1;
    width: 100%;
    /* Ensure full width for centering */
    display: flex;
    justify-content: center;
  }

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

@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .header-inner {
    padding: 0 25px;
    /* Increased padding */
  }

  .theme-toggle {
    margin-right: 5px;
    /* Add safety margin */
  }

  .mobile-menu-btn {
    display: flex;
  }

  .logo {
    display: none;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    gap: 30px;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-150%);
    transition: transform var(--transition-normal);
    z-index: 999;
    box-shadow: var(--shadow-lg);
  }

  .nav-links.active {
    transform: translateY(0);
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }

  .profile-img-container {
    width: 280px;
    height: 280px;
  }
}