/* ========================================
   Portfolio CSS - Mugabe Yunusu
   ======================================== */

/* ----------------------------------------
   CSS Variables / Custom Properties
   ---------------------------------------- */
:root {
  --primary: #4361ee;
  --primary-dark: #3a0ca3;
  --secondary: #f72585;
  --accent: #4cc9f0;
  --dark: #14213d;
  --light: #f8f9fa;
  --gray: #6c757d;
  --white: #ffffff;
  --success: #2ecc71;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

/* ----------------------------------------
   Base Styles / Reset
   ---------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ----------------------------------------
   Navigation / Header
   ---------------------------------------- */
header {
  background-color: var(--white);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo i {
  color: var(--secondary);
}

/* Navbar Profile Picture - Hidden by default, shown on scroll */
.nav-profile-pic {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  margin-left: 0.5rem;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Show profile pic when scrolled past hero image */
.nav-profile-pic.visible {
  display: block;
  opacity: 1;
  transform: scale(1);
}

/* Mobile Menu Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

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

.nav-links a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  transition: var(--transition);
}

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

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark);
  cursor: pointer;
}

/* ----------------------------------------
   Hero Section
   ---------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem;
  background: linear-gradient(
    135deg,
    rgba(67, 97, 238, 0.1) 0%,
    rgba(248, 249, 250, 1) 100%
  );
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  color: var(--dark);
}

.hero-content h1 span {
  color: var(--primary);
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--gray);
  margin-bottom: 2rem;
  max-width: 600px;
}

.contact-info {
  margin-top: 2rem;
}

.contact-info div {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.contact-info i {
  color: var(--primary);
  width: 24px;
  text-align: center;
}

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

.hero-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.hero-image::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--accent));
  opacity: 0.2;
  z-index: 1;
  top: -50px;
  right: -50px;
  animation: float 6s ease-in-out infinite;
}

.hero-image::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--secondary), var(--accent));
  opacity: 0.2;
  z-index: 1;
  bottom: -50px;
  left: -50px;
  animation: float 8s ease-in-out infinite;
}

/* ----------------------------------------
   Animations
   ---------------------------------------- */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* ----------------------------------------
   Section Styles (Common)
   ---------------------------------------- */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--dark);
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.section-title h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

/* ----------------------------------------
   Projects Section
   ---------------------------------------- */
.projects {
  padding: 6rem 2rem;
  background-color: var(--white);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
}

.project-card {
  background-color: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.project-image {
  height: 200px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-content {
  padding: 1.5rem;
}

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

.project-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--gray);
}

.project-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-content p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  background-color: var(--light);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(67, 97, 238, 0.2);
}

.project-links {
  display: flex;
  gap: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

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

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

.secondary-link {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.secondary-link:hover {
  background-color: rgba(67, 97, 238, 0.1);
}

/* ----------------------------------------
   Contact Section
   ---------------------------------------- */
.contact {
  padding: 6rem 2rem;
  background: linear-gradient(
    135deg,
    rgba(67, 97, 238, 0.1) 0%,
    rgba(248, 249, 250, 1) 100%
  );
}

.contact-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

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

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  background-color: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow);
}

.contact-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  color: var(--primary-dark);
}

/* ----------------------------------------
   Footer
   ---------------------------------------- */
footer {
  background-color: var(--dark);
  color: var(--white);
  padding: 2rem;
  text-align: center;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.social-links {
  display: flex;
  gap: 1.5rem;
}

.social-link {
  color: var(--white);
  font-size: 1.2rem;
  transition: var(--transition);
}

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

.copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* ----------------------------------------
   Responsive Design - Tablet
   ---------------------------------------- */
@media (max-width: 1024px) {
  .hero-container {
    gap: 2rem;
  }

  .hero-content h1 {
    font-size: 3rem;
  }
}

/* ----------------------------------------
   Responsive Design - Mobile
   ---------------------------------------- */
@media (max-width: 768px) {
  /* Adjust logo for mobile */
  .logo span {
    font-size: 1.2rem;
  }

  /* Mobile Navigation - Slide from Right, Half Width */
  .nav-links {
    display: flex;
    position: fixed;
    top: 0;
    right: -60%;
    width: 60%;
    max-width: 280px;
    height: 100vh;
    flex-direction: column;
    background-color: var(--white);
    padding: 5rem 2rem 2rem;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: right 0.3s ease;
    gap: 1rem;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .mobile-menu-btn {
    display: block;
    z-index: 1001;
  }

  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-content {
    order: 2;
  }

  .hero-image {
    order: 1;
  }

  .hero-content p {
    margin-left: auto;
    margin-right: auto;
  }

  .contact-info {
    justify-content: center;
  }

  .hero-image::before,
  .hero-image::after {
    display: none;
  }
}

/* ----------------------------------------
   Responsive Design - Small Mobile
   ---------------------------------------- */
@media (max-width: 576px) {
  .hero {
    padding-top: 6rem;
  }

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

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

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

  .project-links {
    flex-direction: column;
  }

  .project-link {
    justify-content: center;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .contact-link {
    width: 100%;
    justify-content: center;
  }
}
