/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f9f9f9;
  color: #222;
  transition: background-color 0.4s ease, color 0.4s ease;
  opacity: 1;
  line-height: 1.6;
}

/* ===== Dark Mode ===== */
body.dark {
  background-color: #111;
  color: #f1f1f1;
}

/* ===== Header ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 10%;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

body.dark header {
  background: rgba(255, 255, 255, 0.08);
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
}

nav {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  position: relative;
  padding: 6px 10px;
  transition: color 0.3s ease;
}

nav a.active,
nav a:hover {
  color: #0078ff;
}

#theme-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
}

/* ===== Hero Section ===== */
.hero {
  min-height: 90vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 10%;
  gap: 10px;
}

.hero-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-text {
  flex: 1;
}

.hero-text h2 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 15px;
}

.hero-text span {
  color: #0078ff;
}

.hero-text p {
  font-size: 1.1rem;
  margin-bottom: 25px;
}

.btn {
  padding: 10px 20px;
  background-color: #0078ff;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #005fcc;
}

.hero-image img {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: fill;
  border: 4px solid #0078ff;
}

/* ===== About Section ===== */
.about-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  padding: 80px 10%;
}

.about-image img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: fill;
  border: 4px solid #0078ff;
}

.about-text {
  flex: 1;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 15px;
}

.about-text p {
  margin-bottom: 15px;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ===== Projects ===== */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  padding: 60px 10%;
}

.project-card {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark .project-card {
  background: rgba(255, 255, 255, 0.05);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

.project-info {
  padding: 20px;
}

.project-info h3 {
  margin-bottom: 10px;
  color: #0078ff;
}

.project-info p {
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.project-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background-color: #444;
}

body.dark .btn-secondary {
  background-color: #ddd;
  color: #111;
}

/* ===== Contact ===== */
.content {
  text-align: center;
  padding: 80px 10%;
}

.contact-links {
  list-style: none;
  margin-top: 30px;
}

.contact-links li {
  margin-bottom: 15px;
}

.contact-links a {
  text-decoration: none;
  font-weight: 600;
  color: #0078ff;
  transition: color 0.3s ease;
}

.contact-links a:hover {
  color: #005fcc;
}

/* ===== Page Fade Transitions ===== */
.fade-in {
  animation: fadeIn 0.6s ease-in forwards;
  opacity: 0;
}

.fade-out {
  animation: fadeOut 0.5s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* ===== Responsive Design ===== */

/* 📱 Small Phones (up to 480px) */
@media (max-width: 480px) {
  header {
    flex-direction: column;
    padding: 15px 5%;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .hero-text h2 {
    font-size: 1.8rem;
  }

  .hero-text p {
    font-size: 1rem;
  }

  .btn {
    display: inline-block;
    font-size: 0.9rem;
  }

  .hero-image img,
  .about-image img {
    width: 180px;
    height: 180px;
  }

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

/* 📲 Tablets (481px–768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .hero-content,
  .about-section {
    flex-direction: column;
    text-align: center;
  }

  .hero-text h2 {
    font-size: 2rem;
  }

  .hero-image img,
  .about-image img {
    width: 220px;
    height: 220px;
  }

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

/* 💻 Laptops (769px–1200px) */
@media (min-width: 769px) and (max-width: 1200px) {
  .hero-text h2 {
    font-size: 2.3rem;
  }

  .about-image img {
    width: 260px;
    height: 260px;
  }

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

/* 🖥️ Large Desktops (1201px and up) */
@media (min-width: 1201px) {
  .projects {
    grid-template-columns: repeat(3, 1fr);
  }
}