:root {
  --bg-color: #fafafa;
  --text-color: #222;
  --accent: #000;
  --card-bg: #fff;
  --soft-bg: #f7f9fc;
  --shadow: rgba(0,0,0,0.08);
}
body.dark {
  --bg-color: #121212;
  --text-color: #f5f5f5;
  --accent: #9e9e9e;
  --card-bg: #1e1e1e;
  --soft-bg: #2a2a2a;
  --shadow: rgba(255,255,255,0.05);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  transition: background 0.4s, color 0.4s;
}

.container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navigation */
nav {
  background: var(--card-bg);
  box-shadow: 0 2px 8px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s, transform 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  border: none;
  background: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-color);
}

/* 🌙 Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--card-bg), var(--soft-bg));
  padding: 6rem 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
}

.hero-text h1 {
  font-size: 2.8rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.hero-text h2 {
  font-size: 1.3rem;
  opacity: 0.8;
  margin-bottom: 1rem;
}

.hero-text p {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.contact-info p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.buttons {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s;
}

.btn:hover {
  background: transparent;
  color: var(--accent);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

/* Hero Image */
.hero-image {
  display: flex;
  justify-content: center;
}

.profile-photo {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--soft-bg), var(--card-bg));
  border: 3px solid var(--accent);
  box-shadow: 0 8px 20px var(--shadow);
}

/* Social Links */
.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 42px;
  height: 42px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 50%;
  font-size: 1.2rem;
  transition: all 0.3s;
}

.social-links a:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1);
}

/* Sections */
section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2.5rem;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* Cards */
.project-card, .education-item, .skill-category, .contact-item {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--shadow);
  padding: 2rem;
  transition: all 0.3s;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px var(--shadow);
}

.tech-tag {
  background: var(--accent);
  color: #fff;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.skill-item {
  background: rgba(0, 119, 255, 0.15);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* Contact Grid */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.contact-item h3 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  background: var(--soft-bg);
  color: var(--text-color);
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-photo {
    width: 200px;
    height: 200px;
  }

  .buttons {
    flex-direction: column;
    align-items: center;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--card-bg);
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 1rem 0;
  }

  .nav-links.active {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }
}


/* Desktop default: theme toggle inside nav bar */
.theme-toggle {
  background: none;
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-left: 1rem;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* 🌙 Mobile view: move theme button outside nav bar */
@media (max-width: 768px) {
  .theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px var(--shadow);
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
    transition: transform 0.3s;
  }

  .theme-toggle:hover {
    transform: scale(1.1);
  }
}

/* Fix for overlapping skills & project tech stack on mobile */
@media (max-width: 768px) {
  /* Ensure projects and skills stack cleanly */
  .projects-grid,
  .skills-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .project-card,
  .skill-category {
    padding: 1.2rem;
    margin-bottom: 1rem;
  }

  /* Make tech stack tags wrap properly */
  .tech-tags,
  .skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .tech-tag,
  .skill-item {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    white-space: nowrap;
  }

  /* Ensure inner content doesn’t overflow */
  .project-card p,
  .skill-category p {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

