.projects-section {
  width: 100%;
  margin-top: 19rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-margin-top: 6.2rem;
}

.projects-section h3 {
  margin-bottom: 40px;
  font-size: clamp(2.1rem, 6vw, 4.5rem);
  background-image: linear-gradient(rgb(133, 133, 133), rgb(255, 255, 255));
  color: transparent;
  background-clip: text;
}

.slider {
  width: 100%;
  height: 40rem;
  mask-image: linear-gradient(to right, transparent, #000 10% 90%, transparent);
  overflow: hidden;
}

.slider .list {
  display: flex;
  min-width: calc(50rem * var(--quantity));
  position: relative;
}

.slider .list .item {
  width: 46rem;
  height: auto;
  position: absolute;
  top: 29px;
  left: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  padding: 15px 15px 20px 15px;
  animation: autoRun 25s linear infinite;
  animation-delay: calc(
    (25s / var(--quantity)) * (var(--position) - 1) - 10s
  ) !important;
  transition: 0.2s;
  box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--c-lightblue);
  background-image: -webkit-linear-gradient(
      top,
      rgba(0, 0, 0, 0),
      rgba(0, 0, 0, 0.35)
    ),
    url(/images/bg02.webp);
  overflow: hidden;
  gap: 5px;
}

.slider .list .item video {
  width: 100%;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

@keyframes autoRun {
  from {
    left: 50%;
  }
  to {
    left: calc(240rem * -1);
  }
}

.slider:has(.item:hover) .item {
  animation-play-state: paused !important;
}

.slider .item:hover {
  scale: 1.1;
}

.content {
  width: 95%;
  margin-top: 20px;
}

.category-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding-bottom: 10px;
}

.title a {
  width: 100%;
  font-size: 23px;
  font-weight: 300;
  text-transform: uppercase;
  line-height: 34px;
  display: flex;
  color: var(--c-white);
  align-items: center;
  justify-content: start;
  gap: 8px;
}

.project-description {
  width: 100%;
  line-height: 1.3;
  margin-top: 5px;
  font-size: 1rem;
}

.tech-pill {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-line);
  padding: 5px 10px;
  border-radius: 15px;
  margin-right: 3px;
  background-color: var(--c-white);
}

.read-more {
  width: fit-content;
  display: block;
  color: var(--c-secondary);
  text-decoration: none;
  font-weight: 300;
  margin-top: 5px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.read-more:hover {
  border-bottom: 1px solid var(--c-secondary);
}

.project-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.flex-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-top: 1rem;
  gap: 2.5rem;
}

.project-image {
  position: relative;
  flex: 1 1 30%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.skeleton {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #eee, #ddd, #eee);
  background-size: 200% 100%;
  animation: skeleton-loading 1.2s ease-in-out infinite;
  position: absolute;
  top: 0;
  left: 0;
}

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

.project-preview-img {
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

.project-preview-img.loaded {
  opacity: 1;
}

.project-image .project-preview-img.loaded + .skeleton,
.project-image .skeleton.hidden {
  display: none;
}

.project-details {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  color: var(--c-light_gray);
  line-height: 1.6;
}

.project-details > div {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.project-details > div:last-child {
  border-bottom: none;
}

.project-title {
  color: var(--c-secondary);
  font-size: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 300;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--c-white);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-pill {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-line);
  padding: 5px 10px;
  border-radius: 15px;
  margin-right: 3px;
  background-color: var(--c-white);
}

.links-list {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-btn {
  width: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 300;
  border-radius: 50px;
  padding: 10px 1.5rem;
  color: var(--c-light_gray);
  text-transform: uppercase;
  background-color: var(--c-primary);
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.5);
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  background-image: -webkit-linear-gradient(
      top,
      rgba(0, 0, 0, 0),
      rgba(0, 0, 0, 0.35)
    ),
    url(/images/bg02.webp);
  box-shadow: inset 0px 0px 0px 1px rgba(0, 0, 0, 0.35),
    inset 0px 2px 1px 0px rgba(255, 255, 255, 0.35);
  transition: 0.3s;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.3s ease;
}

.project-btn:hover {
  color: var(--c-white);
  background-color: var(--c-lightblue);
}

/* Dates */
.date-info {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.features ul,
.future-improvements ul {
  padding-left: 1.5rem;
  list-style-type: disc;
  margin-top: 0.5rem;
}

.features li,
.future-improvements li {
  margin-bottom: 0.3rem;
}

.meta {
  text-align: right;
}

.meta span i {
  margin-right: 2px;
  font-size: 13px;
}

.meta span a i {
  margin-right: 2px;
  font-size: 13px;
}

@media (max-width: 1400px) {
  .slider .list .item {
    width: 40rem;
  }
  .slider .list {
    min-width: calc(38rem * var(--quantity));
  }
}

@media (max-width: 1020px) {
  .slider {
    height: auto;
    mask-image: none;
    overflow: visible;
  }

  .slider .list {
    display: flex;
    flex-direction: column;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    position: relative;
    gap: 2rem;
  }

  .slider .list .item {
    width: 100% !important;
    max-width: 100% !important;
    position: relative;
    left: 0 !important;
    top: 0 !important;
    animation: none !important;
    transform: none !important;
    scale: 1 !important;
  }

  .slider .item:hover {
    scale: 1 !important;
  }
}

@media (max-width: 768px) {
  .flex-layout {
    flex-direction: column;
  }

  .project-image,
  .project-details {
    flex: 1 1 100%;
  }

  .projects-section {
    margin-top: 4rem;
  }

  .project-title {
    font-size: 1.3rem;
    text-align: center;
  }

  .meta {
    margin-top: 5px;
  }

  .title a {
    font-size: 1.1rem;
  }
  
  .section-title {
    font-size: 1rem;
  }
}

@media (max-width: 490px) {
  .tech-pill,
  .project-pill {
    font-size: 0.70rem;
    padding: 0.25rem 0.6rem;
  }

  .project-container {
    padding: 20px 10px;
  }
}
