/* PROJECTS PAGE BACKGROUND */
body {
  background: #05060f;
  font-family: "Poppins", sans-serif;
  color: #fff;
  display: flex;
  justify-content: center;
  padding: 70px 0;
  opacity: 0;
  animation: fadeInPage 1.2s ease forwards;
}

@keyframes fadeInPage {
  to {
    opacity: 1;
  }
}
.projects-section {
  width: 90%;
  max-width: 1200px;
  text-align: center;
}

.title-main {
  font-size: 2.4rem;
  margin-bottom: 40px;
  color: #b39a84;

}

.projects-container {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}




/* =============== FLIP CARD (Provided) =============== */
.flip-card {
  background-color: transparent;
  width: 240px;
  height: 300px;
  perspective: 1000px;
  font-family: "Montserrat", sans-serif;
}

.title {
  font-size: 1.5em;
  font-weight: 900;
  text-align: center;
  margin: 0;
  
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  box-shadow: 0 8px 14px 0 rgba(0, 0, 0, 0.2);
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border: 1px solid #a85a45;
  border-radius: 1rem;
}

.flip-card-front {
  background: linear-gradient(
    120deg,
    #c9b7a0 60%,
    #d9bba7 88%,
    #d8a78b 40%,
    rgba(204, 88, 56, 0.603) 48%
  );
  color: #a85a45;
}

.flip-card-back {
  background: linear-gradient(
    120deg,
    #e69980 30%,
    #a85a45 88%,
    #c9b7a0 40%,
    #d89d8f 78%
    
  );
  color: #352f2d;
  transform: rotateY(180deg);
  padding: 20px;
  font-family:  "Fira Code", monospace;
}

/* =============== GITHUB BUTTON =============== */
.github-btn {
  margin-top: auto;
  padding: 8px 14px;
  background: #eee;
  color: #a85a45;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  transition: 0.3s;
}

.github-btn:hover {
  background: #a85a45;
  color: #fff;
}

/* Click fixes */
.flip-card-back a {
  pointer-events: auto;
}
.flip-card-back {
  pointer-events: auto;
}

/* RESPONSIVE */
@media (max-width: 800px) {
  .projects-container {
    flex-direction: column;
    align-items: center;
  }
}

/* STAR BACKGROUND LAYERS */
.stars, .stars2, .stars3 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: repeat;
  z-index: -1;
  pointer-events: none;
}

.stars {
  background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
  opacity: 0.7;
  animation: moveStars 140s linear infinite;
}

.stars2 {
  background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
  opacity: 0.4;
  animation: moveStars 200s linear infinite;
}

.stars3 {
  background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
  opacity: 0.2;
  animation: moveStars 260s linear infinite;
}

@keyframes moveStars {
  from { background-position: 0 0; }
  to { background-position: 2000px 2000px; }
}
/* ===================== */
/*   MOBILE OPTIMIZATION */
/* ===================== */

/* Tablet */
@media (max-width: 768px) {
  .cards-container {
    flex-direction: column;
    gap: 25px;
    align-items: center;
  }

  .parent {
    width: 350px;
    height: auto;
  }

  .content {
    padding: 80px 40px 20px 20px;
  }
}

/* Phone */
@media (max-width: 480px) {
  /* Prevent sideways scrolling */
  html, body {
    overflow-x: hidden;
  }

  /* Card resizing */
  .parent {
    width: 92%;
    height: auto; /* card grows with text */
  }

  /* Reduce 3D animation on phones (smooth & faster) */
  .parent:hover .card {
    transform: none;
  }

  /* Content spacing */
  .content {
    padding: 60px 20px 20px 20px;
  }

  .content .title {
    font-size: 18px;
  }

  .content .text {
    font-size: 16px;
    line-height: 1.6;
    text-align: justify;
  }

  /* Smaller circles for the logo */
  .logo .circle1 { width: 120px; }
  .logo .circle2 { width: 100px; }
  .logo .circle3 { width: 80px; }
  .logo .circle4 { width: 60px; }
  .logo .circle5 { width: 40px; }

  /* Reduce star animation for performance */
  .stars, .stars2, .stars3 {
    opacity: 0.3;
    animation-duration: 200s;
  }
}

