/* ============ PROJECTS PAGE STYLES (MONOCHROME & FAST) ============ */
body.projects-body {
  overflow-y: auto !important;
  overflow-x: hidden;
  height: auto;
  min-height: 100vh;
}

.p-frame {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: clamp(1rem, 2.5vh, 2rem) clamp(1.2rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Navigation items in top bar */
.top__brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.top__nav {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--muted);
}
.nav-item {
  color: var(--muted);
  transition: color .2s;
}
.nav-item.active {
  color: #fff;
  font-weight: 600;
}
.nav-item:hover {
  color: #fff;
}
.nav-item sup {
  font-size: .65em;
  color: #fff;
  background: rgba(255, 255, 255, .15);
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 2px;
}
.nav-sep {
  color: var(--line);
}

.top__actions {
  justify-self: end;
}

.back-pill {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  font-size: .85rem;
  color: #fff;
  transition: all .2s var(--ease);
}
.back-pill:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.back-pill kbd {
  font-family: var(--mono);
  font-size: .65rem;
  padding: 1px 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  opacity: .7;
}

/* Projects Hero */
.p-hero {
  margin: 3.5rem 0 2.5rem;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 3rem;
  align-items: end;
}

.p-hero__title {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.04em;
  margin-top: .4rem;
}
.shimmer {
  background: linear-gradient(90deg, #fff 0%, #777 50%, #fff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 3.5s linear infinite;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

.p-hero__desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 1.6rem;
}

/* Category Filters */
.p-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.filter-btn {
  padding: .45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  font-size: .82rem;
  font-family: var(--mono);
  color: var(--muted);
  transition: all .2s var(--ease);
}
.filter-btn sup {
  font-size: .7em;
  margin-left: 2px;
}
.filter-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .08);
}
.filter-btn.active {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-weight: 600;
}

/* Projects Grid */
.p-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.p-card {
  position: relative;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 340px;
  backdrop-filter: blur(12px);
  transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
  overflow: hidden;
}
.p-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.p-card:hover {
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .05);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, .8), 0 0 30px rgba(255, 255, 255, .05);
}
.p-card:hover::before {
  opacity: 1;
}

/* Filter hide animation */
.p-card.is-hidden {
  display: none;
}
@keyframes fadeCardIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.p-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
}
.p-card__idx {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--muted);
}
.p-badge {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.p-badge--highlight {
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.p-card__title {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin-bottom: .8rem;
  color: #fff;
}
.p-card__desc {
  font-size: .92rem;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 1.4rem;
  font-weight: 300;
}

.p-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 2rem;
}
.p-card__tags span {
  font-size: .75rem;
  font-family: var(--mono);
  padding: .2rem .6rem;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  color: #ccc;
  transition: all .2s;
}
.p-card:hover .p-card__tags span {
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}

.p-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.p-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  position: relative;
  transition: gap .2s var(--ease);
}
.p-link svg {
  transition: transform .25s var(--ease);
}
.p-link:hover {
  color: #fff;
  gap: .7rem;
}
.p-link:hover svg {
  transform: translate(2px, -2px);
}
.p-meta {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-bottom {
  margin-top: auto;
  padding-top: 2rem;
}

/* Responsive */
@media (max-width: 900px) {
  .p-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
  }
  .p-grid {
    grid-template-columns: 1fr;
  }
  .top__brand {
    gap: 1rem;
  }
  .top__nav {
    display: none;
  }
}
