.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.project-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.project-modal.is-open .project-modal-container {
  transform: scale(1) translateY(0);
}
.project-modal.is-open .project-modal-image img {
  opacity: 1;
  transform: scale(1);
}
.project-modal.is-open .project-modal-title {
  opacity: 1;
  transform: translateY(0);
}
.project-modal.is-open .project-modal-details {
  opacity: 1;
  transform: translateY(0);
}
.project-modal.is-open .project-modal-btn {
  opacity: 1;
  transform: translateY(0);
}

.project-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.project-modal-container {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transform: scale(0.9) translateY(30px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.project-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.project-modal-close:hover {
  transform: scale(1.1) rotate(90deg);
  background: #fff;
}
.project-modal-close svg {
  color: #1a1a2e;
}

.project-modal-content {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow-y: auto;
}
@media (min-width: 992px) {
  .project-modal-content {
    flex-direction: row;
  }
}

.project-modal-image {
  flex: 1;
  min-height: 300px;
  max-height: 60vh;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
@media (min-width: 992px) {
  .project-modal-image {
    max-height: none;
    min-height: 500px;
  }
}
.project-modal-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.project-modal-info {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 992px) {
  .project-modal-info {
    padding: 60px;
    max-width: 500px;
  }
}

.project-modal-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 15px 0;
  color: #1a1a2e;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}
@media (min-width: 992px) {
  .project-modal-title {
    font-size: 2.5rem;
  }
}

.project-modal-details {
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.45s, transform 0.5s ease 0.45s;
}

.project-modal-medium {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 10px;
}

.project-modal-specs {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #555;
}
.project-modal-specs span {
  display: block;
}

.project-modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 25px;
  padding: 12px 18px;
  background: #c41e3a;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 50px;
  width: fit-content;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease 0.6s, transform 0.5s ease 0.6s, background 0.3s ease, gap 0.3s ease;
}
.project-modal-btn:hover {
  background: #a01830;
  gap: 8px;
  color: #fff;
}
.project-modal-btn:hover svg {
  transform: translateX(3px);
}
.project-modal-btn svg {
  transition: transform 0.3s ease;
}

#portfolio-grid .pgi-caption {
  position: relative;
  padding: 15px 10px;
  text-align: center;
  background: #fff;
}
#portfolio-grid .pgi-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0;
}
#portfolio-grid .pgi-category {
  font-size: 0.85rem;
  color: #666;
  margin-top: 5px;
}
#portfolio-grid.pgi-cap-inside .pgi-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  padding: 15px;
}

.portfolio-grid-item .pgi-caption {
  background: #fff;
}

#portfolio-grid.pgi-hover [class*=ttgr-gap-]:not(.ttgr-gap-1) .pgi-image-wrap:hover .pgi-image-holder {
  clip-path: inset(0 0 0 0) !important;
}
#portfolio-grid.pgi-hover .pgi-image-wrap:hover .pgi-image {
  transform: scale(1.08);
}
