/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #3A506B;
  --secondary-color: #5BC0BE;
  --background-color: #f4f7f8;
  --text-color: #333;
  --card-background: #ffffff;
  --accent-color: #1c7293;
}

body {
  font-family: 'Helvetica Neue', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 2rem;
  background-color: var(--card-background);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-left {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--primary-color);
}

.nav-right a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-right a:hover {
  color: var(--accent-color);
}

/* Hero */
.hero {
  padding: 2rem 2rem;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  color: white;
}

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

.hero h1 {
  font-size: 4.5rem;
  margin-bottom: 1rem;
  flex: 1;
  min-width: 200px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: 300px;
  max-width: 600px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: right;
  justify-content: right;
}

.filter-tag {
  padding: 0.2rem 0.6rem;
  background-color: #e0e0e0;
  color: #333;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.filter-tag.active {
  background-color: var(--secondary-color);
  color: white;
}

/* Projects */
.projects-section {
  padding: 3rem 2rem;
}

.projects-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: var(--primary-color);
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}


.project-card {
  display: flex;
  width: 300px;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--card-background);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, background-color 0.3s ease;
  text-decoration: none;
  color: inherit;
  height: 400px;
  overflow: hidden;
}

.project-card img.project-image,
.project-card video.project-video {
  width: 100%;
  height: 160px; /* 220px given 400px container */
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: block; /* Prevent inline spacing issues */
  margin: 0;
  padding: 0;
  border: none;
}


.project-card .card-top {
  display: flex;
  flex-direction: column;
}

.project-card .card-bottom {
  margin-top: auto;
}

.project-card h3,
.project-card .tags,
.project-card p {
  padding: 0 1.2rem;
}

.project-card h3 {
  margin: 1rem 0 0.5rem;
}

.project-card .tags {
  margin-bottom: 1rem;
}

.project-card p {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: #555;
}

.project-card:hover {
  transform: translateY(-6px);
  background-color: var(--background-color);
}

.project-card .tag {
  background-color: #ddd;
  color: #555;
  font-size: 0.6rem;
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
  white-space: nowrap;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.2rem 1rem;
  background-color: var(--card-background);
  font-size: 0.85rem;
  color: #777;
  margin-top: 3rem;
}



.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); ;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 50%;
  width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
  animation: scaleIn 0.3s ease-in-out;
}

.modal-image {
  width: 100%;
  margin-bottom: 20px;
  aspect-ratio: 16 / 9; /* Adjust based on desired shape */
  overflow: hidden;
  border-radius: 10px;
}
.modal-image-collage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 4px;
  width: 100%;
  aspect-ratio: 16 / 9; /* Adjust based on desired shape */
  overflow: hidden;
  border-radius: 10px;
}

.modal-image-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-image-collage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-image img,
.modal-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Default: hide close button */
.close-btn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
}


.modal .title {
      font-size: 2.0em;
      margin-top: 15px;
      color: #2c3e50;
}

.modal .tags{
      margin: 4px 0;
}

.modal .tags .tag {
      display: inline-block;
      background: #e0e0e0;
      color: #333;
      padding: 2px 6px;
      border-radius: 10px;
      font-size: 0.7em;
      margin-right: 5px;
      margin-bottom: 3px;
}

.modal .section-title {
      margin-top: 15px;
      color: #34495e;
      font-size: 1.4em;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.modal p {
      line-height: 1.6;
}

.modal ul {
  padding-left: 20px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.modal li {
  margin-bottom: 6px;
  line-height: 1.5;
}


.more-button {
  text-decoration: none;
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.more-button:hover {
  background-color: var(--accent-color);
}

.projects-description {
  width: 100%;
  box-sizing: border-box; /* ensures padding doesn’t increase total width */
  margin: 0 auto;
}


.description-row {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.description-row.reverse {
  flex-direction: row-reverse;
}

.description-image {
  flex: 1 1 33%; /* roughly 1/3 of width */
  max-width: 33%;
}

.description-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.description-text {
  flex: 2 1 67%; /* roughly 2/3 of width */
}

.description-text h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.description-text p {
  margin: 0;
  line-height: 1.5;
  color: #333;
}



@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { background-color: rgba(0,0,0,0); }
  to { background-color: rgba(0, 0, 0, 0.5); }
}


/* Responsive */
@media (max-width: 1000px) {
  .hero-content {
    flex-direction: column;
  }

  .modal-content {
    max-width: 90%;
    width: 100%;
  }

  .filters {
    margin-top: 1rem;
  }

  .filter-group {
    align-items: center;
    justify-content: center;
  }
  .close-btn.mobile-only {
    display: block;
  }
}