/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100vh;
  font-family: 'Khula', sans-serif;
  overflow-x: hidden;
  background: linear-gradient(135deg, #0a192f 0%, #112240 50%, #1a365d 100%);
  color: white;
  position: relative;
}

/* Animated Gradient Background with Orbs */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(100, 255, 218, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(167, 139, 250, 0.1) 0%, transparent 60%);
  pointer-events: none;
  animation: moveGradient 15s ease infinite;
}

@keyframes moveGradient {
  0%, 100% { 
    background-position: 0% 0%, 100% 100%, 50% 50%;
    opacity: 1;
  }
  50% { 
    background-position: 100% 100%, 0% 0%, 30% 70%;
    opacity: 0.8;
  }
}

/* Wrapper */
#wrapper {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 20px 60px;
}

/* Back Button */
.back-btn {
  position: fixed;
  top: 30px;
  left: 30px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(100, 255, 218, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(100, 255, 218, 0.3);
  border-radius: 50px;
  color: #64ffda;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  font-family: 'Space Grotesk', sans-serif;
}

.back-btn:hover {
  background: rgba(100, 255, 218, 0.2);
  border-color: #64ffda;
  transform: translateX(-5px);
  box-shadow: 0 10px 30px rgba(100, 255, 218, 0.3);
}

.back-btn svg {
  transition: transform 0.3s ease;
}

.back-btn:hover svg {
  transform: translateX(-3px);
}

/* Page Title */
.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.title-line {
  display: block;
  background: linear-gradient(120deg, #64ffda, #00d4ff, #a78bfa);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Projects Container */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  max-width: 1200px;
  width: 100%;
  padding: 0 20px;
  margin-bottom: 60px;
}

/* Project Card */
.project-card {
  position: relative;
  background: rgba(17, 25, 40, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(100, 255, 218, 0.2);
  border-radius: 20px;
  padding: 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #64ffda, #00d4ff, #a78bfa);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover::before {
  opacity: 1;
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-card:hover .card-glow {
  opacity: 1;
  animation: rotateGlow 3s linear infinite;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(100, 255, 218, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* Card Content */
.card-content {
  position: relative;
  z-index: 2;
}

.project-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #64ffda, #00d4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
  opacity: 0.6;
}

.project-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 15px;
  line-height: 1.3;
}

.project-description {
  color: #8892b0;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* Tech Tags */
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 25px;
}

.tech-tag {
  padding: 6px 14px;
  background: rgba(100, 255, 218, 0.1);
  border: 1px solid rgba(100, 255, 218, 0.3);
  border-radius: 20px;
  font-size: 0.8rem;
  color: #64ffda;
  font-weight: 600;
  transition: all 0.3s ease;
}

.project-card:hover .tech-tag {
  background: rgba(100, 255, 218, 0.2);
  border-color: #64ffda;
}

/* Project Link */
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #64ffda;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  font-family: 'Space Grotesk', sans-serif;
}

.project-link:hover {
  gap: 12px;
  color: #00d4ff;
}

.project-link svg {
  transition: transform 0.3s ease;
}

.project-link:hover svg {
  transform: translateX(3px);
}

.project-link.disabled {
  color: #8892b0;
  cursor: not-allowed;
  pointer-events: none;
}

/* Coming Soon Cards */
.project-card.coming-soon {
  opacity: 0.7;
}

.project-card.coming-soon .project-number {
  opacity: 0.4;
}

.project-card.coming-soon:hover {
  transform: translateY(-4px);
}

/* Scroll Animation */
.project-card {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  #wrapper {
    padding: 100px 15px 40px;
  }

  .back-btn {
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  .page-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
  }

  .projects-container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 15px;
  }

  .project-card {
    padding: 25px;
  }

  .project-number {
    font-size: 2.5rem;
  }

  .project-title {
    font-size: 1.3rem;
  }

  .project-description {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .back-btn span {
    display: none;
  }

  .back-btn {
    padding: 10px;
    border-radius: 50%;
  }

  .page-title {
    font-size: 2rem;
  }

  .project-card {
    padding: 20px;
  }

  .project-number {
    font-size: 2rem;
  }
}