.project-page {
  padding-top: 0;
  top:0;
}

.project-hero {
  position: relative;
  padding: clamp(5rem, 9vw, 7rem) 0 clamp(1.75rem, 5vw, 3.25rem);
  overflow: hidden;
}

.project-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.18), transparent 48%),
              radial-gradient(circle at 82% 12%, rgba(135, 82, 255, 0.25), transparent 55%),
              linear-gradient(135deg, rgba(132, 71, 229, 0.35), rgba(36, 5, 86, 0.6));
  opacity: 0.92;
  pointer-events: none;
}

.project-hero::after {
  content: '';
  position: absolute;
  width: clamp(18rem, 35vw, 28rem);
  height: clamp(18rem, 35vw, 28rem);
  right: -12%;
  top: -18%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(0.5px);
  pointer-events: none;
}

.project-hero-body {
  position: relative;
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
}

.project-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 1.25rem;
}

.project-hero .section-title {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

.project-hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1rem);
  line-height: 1.75;
  color: rgba(255,255,255,0.66);
  margin: 0 auto clamp(2rem, 5vw, 2.75rem);
  max-width: 720px;
}


.project-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(1rem, 3vw, 1.75rem);
  margin: 0 auto clamp(1.25rem, 4vw, 2rem);
  justify-items: center;
  width: min(720px, 100%);
}

.metric-item {
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(12, 3, 32, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 110px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.metric-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 600;
}

.metric-label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.project-filters {
  position: sticky;
  top: clamp(2px, 2.5vw, 4px);
  z-index: 140;
  padding: clamp(0.3rem, 0.9vw, 0.25rem) 0;
  display: flex;
  justify-content: center;
}

.project-filters .container {
  display: flex;
  justify-content: center;
}


.project-filters-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: clamp(0.45rem, 1.4vw, 0.75rem);
  padding: clamp(0.5rem, 1vw, 0.75rem) clamp(0.5rem, 2vw, 1rem);
  border-radius: 999px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.18) 60%),
    linear-gradient(320deg, rgba(132, 92, 255, 0.2) 0%, rgba(255, 255, 255, 0) 65%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.5),
    0 22px 48px -34px rgba(32, 0, 92, 0.45),
    0 12px 26px -20px rgba(193, 172, 255, 0.35);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  transition: box-shadow 0.25s ease;
  overflow: hidden;
}

.project-filters-inner::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.08) 72%);
  opacity: 0.65;
  pointer-events: none;
}

.project-filters-inner::after {
  content: '';
  position: absolute;
  top: -55%;
  left: -30%;
  width: 160%;
  height: 150%;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0) 36%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 64%);
  opacity: 0.55;
  mix-blend-mode: screen;
  transform: rotate(10deg);
  pointer-events: none;
}

.project-filters.is-stuck .project-filters-inner {
  box-shadow:
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.58),
    0 28px 60px -36px rgba(32, 0, 92, 0.5),
    0 14px 30px -22px rgba(193, 172, 255, 0.38);
}

.project-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.3rem, 1vw, 0.5rem);
  justify-content: center;
}

.project-filter-group .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: clamp(0.5rem, 1.6vw, 0.7rem) clamp(1rem, 2.5vw, 1.4rem);
  min-width: clamp(120px, 20vw, 145px);
  min-height: 3px;
  font-weight: 600;
  font-size: clamp(0.7rem, .5vw, 0.5rem);
  letter-spacing: 0.01em;
  color: #230240;
  border: 1px solid rgba(40, 8, 86, 0.18);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 24px -18px rgba(20, 0, 60, 0.24);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.project-filter-group .btn .filter-label-short {
  display: none;
}

.project-filter-group .btn .filter-label-full {
  display: inline;
}

.project-filter-group .btn:hover {
  color: #150c3c;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(40, 8, 86, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -18px rgba(20, 0, 60, 0.28);
}

.project-filter-group .btn.active {
  color: #230240;
  background: linear-gradient(135deg, #b68fd9 0%, #eac7ff 100%);
  border-color: transparent;
  box-shadow: 0 18px 30px -20px rgba(136, 101, 233, 0.45);
}

.project-filter-group .btn:focus-visible {
  outline: 2px solid rgba(18, 0, 41, 0.35);
  outline-offset: 3px;
}

@supports not ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))) {
  .project-filters-inner {
    background: #ffffff;
    border-color: rgba(33, 10, 74, 0.1);
    box-shadow: 0 10px 26px -18px rgba(20, 0, 60, 0.24);
  }

  .project-filter-group .btn {
    background: #ffffff;
    border-color: rgba(40, 8, 86, 0.18);
    color: #1d1550;
    box-shadow: 0 12px 24px -18px rgba(20, 0, 60, 0.22);
  }

  .project-filter-group .btn.active {
    background: linear-gradient(135deg, #6a3deb 0%, #4b1bb5 100%);
    color: #fff;
    border-color: transparent;
  }
}

.project-list {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.project-item {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.project-card .project-title {
  font-size: 1.12rem;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.project-card .project-desc {
  letter-spacing: var(--paragraph-letter-spacing);
}

.project-item.d-none {
  opacity: 0;
  pointer-events: none;
}

.project-item:not(.d-none) {
  animation: fadeInProject 0.35s ease;
}

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

@media (max-width: 991.98px) {
  .project-filters-inner {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 999px;
    padding: 0.5rem 0.65rem;
    gap: 0.45rem;
  }

  .project-filter-group .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 0.55rem);
    padding: 0.5rem 0.9rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .project-filters {
    top: 10px;
    padding: 0;
  }

  .project-filters .container {
    justify-content: center;
  }

  .project-filters-inner {
    width: min(620px, 92%);
    gap: 0.35rem;
    padding: 0.45rem 0.6rem;
  }

  .project-filter-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    width: 100%;
    margin: 0;
  }

  .project-filter-group .btn {
    min-width: 0;
    padding: 0.48rem 0.75rem;
    font-size: 0.82rem;
    min-height: 44px;
  }

  .project-filter-group .btn .filter-label-full {
    display: inline;
  }

  .project-filter-group .btn .filter-label-short {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .project-page {
    padding-top: 0;
  }

  .project-hero {
    padding: 1.8rem 0 1.6rem;
  }

  .project-hero-body {
    text-align: center;
    padding-inline: 0.6rem;
  }

  .project-hero-tag {
    margin-bottom: 0.75rem;
    font-size: 0.76rem;
  }

  .project-hero-subtitle {
    font-size: 0.96rem;
    margin-bottom: 1.4rem;
    line-height: 1.65;
  }

  .project-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    width: min(340px, 100%);
    margin: 0 auto 0.9rem;
  }

  .metric-item {
    min-height: 86px;
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    box-shadow: 0 8px 20px -18px rgba(0, 0, 0, 0.45);
  }

  .metric-value {
    font-size: 1.35rem;
  }

  .metric-label {
    font-size: 0.72rem;
    letter-spacing: 0.09em;
  }

  .project-filters {
    top: calc(64px + env(safe-area-inset-top, 0px));
    padding: 0;
  }

  .project-filters .container {
    width: 100%;
    max-width: none;
    padding: 0;
    display: flex;
    justify-content: center;
  }

  .project-filters-inner {
    width: 90%;
    border-radius: 999px;
    padding: 0.2rem clamp(0.2rem, 3vw, 0.5rem);
    gap: clamp(0.08rem, 0.8vw, 0.22rem);
    margin: 0 auto;
    overflow: hidden;
  }

  .project-filter-group {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: clamp(0.12rem, 0.9vw, 0.24rem);
    margin: 0;
    padding: 0;
  }

  .project-filter-group .btn {
    min-width: 0;
    padding: clamp(0.38rem, 1.9vw, 0.5rem) clamp(0.26rem, 3vw, 0.58rem);
    min-height: 38px;
    font-size: 0.74rem;
    border-radius: 999px;
    white-space: nowrap;
  }

  .project-filter-group .btn.active {
    background: linear-gradient(145deg, #f7eaff 0%, #e4cffc 100%);
    border-color: rgba(121, 71, 255, 0.4);
    box-shadow: 0 12px 24px -16px rgba(49, 15, 112, 0.36);
  }

  .project-filter-group .btn .filter-label-full {
    display: none;
  }

  .project-filter-group .btn .filter-label-short {
    display: inline;
  }

  .project-list {
    padding-top: 1.05rem;
  }

  #projects-list {
    row-gap: 1.05rem;
  }

  .project-card {
    padding: 0.95rem 0.9rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 28px -22px rgba(18, 0, 58, 0.32);
    text-align: left;
  }

  .project-card .project-title {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }

  .project-card .project-desc {
    letter-spacing: var(--paragraph-letter-spacing);
  }
}

@media (max-width: 575.98px) {
  .project-page .section-title {
    margin-top: 80px;
  }

  .project-metrics {
    width: min(340px, 100%);
  }

  .metric-item {
    min-width: auto;
  }

  .project-filters{
    top: 25px;
    z-index: 140;
    padding: clamp(0.12rem, 1vw, 0.3rem) 0;
  }

  .project-filters-inner {
    width: 92%;
    padding: 0.38rem clamp(0.34rem, 3.5vw, 0.62rem);
  }

  .project-filter-group {
    gap: clamp(0.1rem, 0.8vw, 0.18rem);
  }

  .project-filters-inner {
    width: 92%;
  }

  .project-filter-group {
    gap: clamp(0.1rem, 0.8vw, 0.2rem);
  }

  .project-filter-group .btn {
    font-size: 0.68rem;
    padding: 0.36rem 0.42rem;
    min-height: 34px;
  }
}
