.fade {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.fade.in {
  opacity: 1;
  transform: none;
}

.d1 {
  transition-delay: 0.08s;
}

.d2 {
  transition-delay: 0.16s;
}

.d3 {
  transition-delay: 0.24s;
}

#navbar {
  transition:
    background 0.3s,
    box-shadow 0.3s;
}

#navbar.scrolled {
  background: rgba(245, 246, 250, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 #e2e5ef;
}

.proj-card {
  cursor: pointer;
  transition:
    box-shadow 0.3s,
    transform 0.3s;
}

.proj-card:hover {
  box-shadow: 0 12px 40px rgba(10, 12, 18, 0.1);
  transform: translateY(-4px);
}

.img-wrap {
  position: relative;
  overflow: hidden;
}

.img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.proj-card:hover .img-overlay {
  opacity: 1;
}

.img-overlay span {
  background: #fff;
  color: #0a0c12;
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-btn {
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.73rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid #e2e5ef;
  background: #fff;
  color: #8b91a8;
  transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
  background: #00bfb0;
  color: #fff;
  border-color: #00bfb0;
}

#modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10, 12, 18, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

#modal-box {
  background: #fff;
  border-radius: 24px;
  max-width: 820px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
  box-shadow: 0 32px 80px rgba(10, 12, 18, 0.28);
}

#modal-backdrop.open #modal-box {
  transform: none;
}

#modal-box::-webkit-scrollbar {
  width: 5px;
}

#modal-box::-webkit-scrollbar-thumb {
  background: #e2e5ef;
  border-radius: 3px;
}

#paginazione {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 48px;
}

#paginazione button {
  font-family: "Familjen Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.73rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid #e2e5ef;
  background: #fff;
  color: #8b91a8;
  transition: all 0.2s;
}

#paginazione button.active {
  background: #00bfb0;
  color: #fff;
  border-color: #00bfb0;
}

#paginazione button:hover:not(.active) {
  border-color: #00bfb0;
  color: #00bfb0;
}

#paginazione .dots {
  padding: 7px 6px;
  color: #8b91a8;
  font-size: 0.73rem;
}

@media (max-width: 960px) {
  .nav-links-desktop {
    display: none !important;
  }

  #mob-btn {
    display: block !important;
  }

  .proj-grid-cols {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 640px) {
  .proj-grid-cols {
    grid-template-columns: 1fr !important;
  }

  .modal-inner-grid {
    grid-template-columns: 1fr !important;
  }
}
