:root {
  --font-primary: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-secondary: "Georgia", Times, "Times New Roman", serif;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- View Switching --- */
.view {
  display: none;
  animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Projects List --- */
.projects-list {
  display: grid;
  gap: 5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.project-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  cursor: pointer;
}

.project-item:nth-child(even) .project-image {
  order: 2;
}

.project-image {
  background-color: var(--bg-card);
  border-radius: 15px;
  height: 25em;
  width: 31em;
  aspect-ratio: 4 / 3;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.project-image img {
  height: 25em;
  width: 31em;
  border-radius: 15px;
}

.project-content {
  width: 600px;
}
.project-item:hover .project-image {
  transform: scale(1.03);
  box-shadow: 0 20px 40px var(--card-shadow);
}

.project-content .project-category {
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-secondary);
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.project-content .project-title {
  font-size: 2.5rem;
  font-weight: 600;
  font-family: var(--font-primary);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.project-content .project-excerpt {
  font-size: 1.1rem;
  line-height: 1.7;
  font-weight: 300;
  font-family: var(--font-secondary);
  margin-bottom: 2rem;
}

.project-content .view-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease, gap 0.3s ease;
}

.project-item:hover .view-project-btn {
  color: var(--accent-secondary);
  gap: 1rem;
}

/* --- Project Detail View --- */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 3rem;
  margin-top: 3rem;
  transition: all 0.3s ease;
}
.back-button:hover {
  background-color: var(--accent-secondary);
  color: white;
}

.detail-header {
  text-align: center;
  padding: 4rem 0;
  background-color: var(--bg-card);
  border-radius: 15px;
  margin-bottom: 4rem;
  font-family: var(--font-primary);
}
.detail-header .project-category {
  font-size: 1rem;
  color: var(--accent-primary);
  font-weight: 600;
}
.detail-header .project-title {
  font-size: 3.5rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 1rem auto 0;
  line-height: 1.2;
}

.detail-body {
  max-width: 800px;
  margin: 0 auto;
}
.detail-body h3 {
  font-size: 1.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-primary);
}
.detail-body p {
  font-size: 1.1rem;
  line-height: 1.9;
  margin-bottom: 2rem;
  font-weight: 300;
  font-family: var(--font-secondary);
}
.detail-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 3rem;
}
.detail-gallery .gallery-image {
  background-color: var(--bg-card);
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  height: 240px;
}
.detail-gallery .gallery-image img {
  height: 240px;
  width: 390px;
  border-radius: 10px;
}

/* --- Responsive --- */
@media (max-width: 2000px) {
  .project-content {
    text-align: center;
    width: 350px;
  }
}

@media (max-width: 1000px) {
  .project-item {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .project-item:nth-child(even) .project-image {
    order: 0;
  }

  .project-image {
    height: 250px;
    width: 350px;
  }
  .project-image img {
    height: 250px;
    width: 350px;
  }
}
@media (max-width: 768px) {
  .project-content .project-title {
    font-size: 2rem;
  }
  .project-content {
    text-align: center;
    width: 350px;
  }
  .project-image {
    height: 250px;
    width: 350px;
  }
  .project-image img {
    height: 250px;
    width: 350px;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 410px) {
  .project-content .project-title {
    font-size: 2rem;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }
}
