.projects {
  padding: 155px 40px;
  background: #fafafa;
}

/* HEADER */

.projects-header {
  text-align: center;
  max-width: 700px;
  margin: auto;
  margin-bottom: 40px;
}

.projects-header .tag {
  background: #eee;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
}

.projects-header h2 {
  font-size: 40px;
  margin: 15px 0;
}

.projects-header p {
  color: #666;
  font-size: 16px;
}

/* FILTERS */

.project-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 40px 0;
}

.project-filters button {
  background: #f3f3f3;
  border: none;
  padding: 8px 18px;
  border-radius: 25px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
  white-space: nowrap;
}

.project-filters button:hover {
  background: #7b3fe4;
  color: white;
}

.project-filters button.active {
  background: #7b3fe4;
  color: white;
}

/* GRID */

.project-grid {
  max-width: 1200px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* CARD */

.project-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: 0.3s;
  cursor: pointer;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card > img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.project-content {
  padding: 20px;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.project-tags span {
  background: #f3f3f3;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.project-content h3 {
  margin: 10px 0;
}

.location {
  font-size: 14px;
  color: #888;
  margin-bottom: 10px;
}

.description {
  color: #555;
  font-size: 14px;
}

/* BEFORE / AFTER IMAGE PANELS */

.ba-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 200px;
  overflow: hidden;
}

.ba-panel {
  position: relative;
  overflow: hidden;
}

.ba-panel img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.ba-panel:hover img {
  transform: scale(1.06);
}

.ba-panel + .ba-panel {
  border-left: 2px solid rgba(255, 255, 255, 0.6);
}

.ba-label {
  position: absolute;
  bottom: 7px;
  left: 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  pointer-events: none;
}

.ba-before .ba-label {
  background: rgba(185, 55, 55, 0.85);
}

.ba-after .ba-label {
  background: rgba(35, 130, 65, 0.85);
}

/* =============================================
   MODAL
   ============================================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.25s ease;
}

.modal.open {
  display: flex;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal box */
.modal-box {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  animation: modalSlideUp 0.28s ease;
}

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

/* Close button */
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.85);
}

/* Image area */
.modal-images {
  position: relative;
  width: 100%;
  height: 420px;
  background: #111;
  overflow: hidden;
}

.modal-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.25s ease;
}

/* Prev / Next arrows */
.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-arrow:hover {
  background: rgba(0, 0, 0, 0.85);
}

.modal-prev { left: 14px; }
.modal-next { right: 14px; }

/* Before / After badge */
.modal-badge {
  position: absolute;
  bottom: 14px;
  left: 14px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
}

.badge-before { background: rgba(185, 55, 55, 0.9); }
.badge-after  { background: rgba(35, 130, 65, 0.9); }

/* Dot / label indicators */
.modal-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.modal-dot {
  background: rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.modal-dot.active,
.modal-dot:hover {
  background: #7b3fe4;
}

/* Info section */
.modal-info {
  padding: 24px 28px 28px;
}

.modal-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.modal-tags span {
  background: #f3f3f3;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.modal-info h3 {
  font-size: 22px;
  margin: 0 0 6px;
}

.modal-location {
  font-size: 14px;
  color: #888;
  margin: 0 0 12px;
}

.modal-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.65;
  margin: 0;
}

/* Modal mobile */
@media (max-width: 600px) {
  .modal-images {
    height: 260px;
  }

  .modal-info {
    padding: 18px 18px 24px;
  }

  .modal-info h3 {
    font-size: 18px;
  }
}

/* MOBILE */

@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .projects {
    padding: 80px 16px;
  }

  .projects-header h2 {
    font-size: 28px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    padding: 0 4px;
  }
}

@media (max-width: 480px) {
  .project-filters {
    gap: 8px;
    margin: 24px 0;
  }

  .project-filters button {
    padding: 6px 14px;
    font-size: 13px;
  }
}