.projects {
  position: relative;
  overflow: hidden;
}

.projects::before {
  content: "";
  position: absolute;
  inset: 8% auto auto 0;
  width: 100%;
  height: 70%;
  background:
    radial-gradient(circle at 18% 22%, rgba(204, 255, 0, 0.1), transparent 32%),
    radial-gradient(circle at 82% 50%, rgba(255, 51, 0, 0.08), transparent 26%);
  pointer-events: none;
  z-index: 0;
}

.projects__header {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.projects__intro {
  margin-top: 1rem;
  max-width: 40rem;
  color: #777;
  font-size: 1.05rem;
  line-height: 1.8;
}

.projects__wrapper {
  display: none;
}

.projects-showcase {
  position: relative;
  z-index: 1;
}

.projects-showcase__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.5rem);
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid rgba(68, 68, 68, 0.7);
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.92) 0%, rgba(17, 17, 17, 0.88) 100%);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.projects-showcase__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(204, 255, 0, 0.5) 50%, transparent 100%);
  pointer-events: none;
}

.projects-showcase__hud {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.projects-showcase__label {
  display: inline-block;
  margin-bottom: 0.45rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #cf0;
}

.projects-showcase__hint {
  color: #777;
  font-size: 0.95rem;
  line-height: 1.6;
}

.projects-showcase__status {
  min-width: min(280px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.projects-showcase__counter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  letter-spacing: -0.04em;
  color: rgba(240, 240, 240, 0.42);
}

.projects-showcase__current {
  color: #f0f0f0;
}

.projects-showcase__divider {
  width: 36px;
  height: 1px;
  background: rgba(240, 240, 240, 0.2);
}

.projects-showcase__progress {
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(68, 68, 68, 0.45);
}

.projects-showcase__progress-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  background: linear-gradient(90deg, #cf0 0%, #fff 100%);
  transform: scaleX(0.08);
  transform-origin: left center;
}

.projects-showcase__viewport {
  position: relative;
  min-height: clamp(560px, 78vh, 780px);
}

.project-slide {
  position: absolute;
  inset: 0;
  padding: clamp(0.5rem, 1vw, 0.75rem);
  pointer-events: none;
  will-change: transform, opacity;
}

.project-slide__grid {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
}

.project-slide__img-wrap {
  position: relative;
  min-height: clamp(320px, 55vh, 560px);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(240, 240, 240, 0.08);
  border-radius: 28px;
  background: #111;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
}

.project-slide__img {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  will-change: transform, filter;
}

.project-slide__img::before {
  content: "";
  position: absolute;
  inset: 12% auto auto 12%;
  width: 42%;
  height: 42%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 72%);
  filter: blur(18px);
  opacity: 0.7;
}

.project-slide__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(5, 5, 5, 0) 0%, rgba(5, 5, 5, 0.35) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 64px);
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
}

.project-slide__number {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(240, 240, 240, 0.12);
  border-radius: 9999px;
  background: rgba(5, 5, 5, 0.55);
  backdrop-filter: blur(10px);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: #f0f0f0;
}

.project-slide__badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  padding: 0.45rem 0.8rem;
  border-radius: 9999px;
  background: rgba(240, 240, 240, 0.08);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #f0f0f0;
  transition: background 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-slide__info {
  max-width: min(440px, 100%);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-slide .project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.project-slide .project-tags li {
  padding: 0.2rem 0.8rem;
  border-radius: 9999px;
  background: rgba(204, 255, 0, 0.12);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: #cf0;
}

.project-slide .project-title {
  max-width: 10ch;
  font-size: clamp(2rem, 3.8vw, 3.9rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  color: #f0f0f0;
  overflow-wrap: anywhere;
  hyphens: auto;
  text-wrap: balance;
}

.project-slide .project-desc {
  color: #777;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.8;
}

.project-slide .project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 0.5rem;
}

.project-slide.is-active .project-slide__img-wrap {
  border-color: rgba(204, 255, 0, 0.45);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(204, 255, 0, 0.08);
}

.project-slide.is-active .project-slide__badge {
  background: #cf0;
  color: #050505;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: #f0f0f0;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-arrow::after {
  content: "\2192";
  transition: transform 0.2s ease;
}

.link-arrow::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 1px;
  background: #cf0;
  transition: width 0.2s ease;
}

.link-arrow:hover {
  color: #cf0;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

.link-arrow:hover::before {
  width: 100%;
}

@media (max-width: 992px) {
  .projects-showcase__hud {
    flex-direction: column;
    align-items: flex-start;
  }

  .projects-showcase__status {
    width: 100%;
  }

  .projects-showcase__counter {
    justify-content: flex-start;
  }

  .projects-showcase__viewport {
    min-height: auto;
    display: grid;
    gap: 1rem;
  }

  .project-slide {
    position: relative;
    inset: auto;
    padding: 0;
    pointer-events: auto;
  }

  .project-slide__grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1rem;
    border: 1px solid rgba(240, 240, 240, 0.08);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.76) 0%, rgba(5, 5, 5, 0.88) 100%);
  }

  .project-slide__img-wrap {
    min-height: auto;
  }

  .project-slide__info {
    max-width: none;
  }

  .project-slide .project-title {
    max-width: none;
    font-size: clamp(1.7rem, 7vw, 2.5rem);
  }
}

@media (max-width: 640px) {
  .projects__intro {
    font-size: 1rem;
  }

  .projects-showcase__panel {
    padding: 0.85rem;
    border-radius: 22px;
  }

  .project-slide__grid {
    padding: 0.85rem;
  }

  .project-slide__number {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }

  .project-slide__badge {
    font-size: 0.68rem;
  }

  .project-slide .project-links {
    gap: 1rem 1.25rem;
  }
}
