.modal {
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 9999 !important;
}

.modal-content {
  animation: scaleIn 0.2s ease-out;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

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

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

.project-thumbnail {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  border-radius: 0.5rem;
}

.project-thumbnail:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

.thumbnail-overlay {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover .thumbnail-overlay {
  opacity: 1;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

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

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

html {
  scroll-behavior: smooth;
}

.project-thumbnail {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-thumbnail:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-card:nth-child(1) {
  animation-delay: 0.1s;
}
.project-card:nth-child(2) {
  animation-delay: 0.2s;
}
.project-card:nth-child(3) {
  animation-delay: 0.3s;
}
.project-card:nth-child(4) {
  animation-delay: 0.4s;
}
.project-card:nth-child(5) {
  animation-delay: 0.5s;
}
.project-card:nth-child(6) {
  animation-delay: 0.6s;
}
.project-card:nth-child(7) {
  animation-delay: 0.7s;
}
.project-card:nth-child(8) {
  animation-delay: 0.8s;
}
.project-card:nth-child(9) {
  animation-delay: 0.9s;
}
.project-card:nth-child(10) {
  animation-delay: 1s;
}
.project-card:nth-child(11) {
  animation-delay: 1.1s;
}
.project-card:nth-child(12) {
  animation-delay: 1.2s;
}
.project-card:nth-child(13) {
  animation-delay: 1.3s;
}
.project-card:nth-child(14) {
  animation-delay: 1.4s;
}
.project-card:nth-child(15) {
  animation-delay: 1.5s;
}
.project-card:nth-child(16) {
  animation-delay: 1.6s;
}

.project-card {
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.project-card.fade-out {
  opacity: 0;
  transform: scale(0.9);
}

.project-card.fade-in {
  opacity: 1;
  transform: scale(1);
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-thumbnail {
  height: 12rem;
  border-radius: 0.5rem;
  background: #e5e7eb;
}

.skeleton-text {
  height: 1rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  background: #e5e7eb;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  width: 70%;
}

.project-card {
  will-change: opacity, transform;
}

.project-thumbnail {
  will-change: transform, filter;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
  animation-fill-mode: both;
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .project-thumbnail,
  .fade-in,
  .fade-out,
  .animate-fade-in {
    animation: none !important;
    transition: none !important;
  }
}
