/* ==========================================================================
   Portfolio Page — Modern, Minimal & Clean Gallery (#9E0C17 on White)
   ========================================================================== */

.portfolio-page {
  background: #ffffff;
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   1. Hero Section
   -------------------------------------------------------------------------- */
.portfolio-hero {
  padding: clamp(48px, 6vw, 76px) 0 clamp(40px, 4vw, 56px);
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

.portfolio-hero__header {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portfolio-hero__eyebrow-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 6px 14px 6px 10px;
  border-radius: 9999px;
  background: #fff5f5;
  border: 1px solid #fee2e2;
}

.portfolio-hero__sparkle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #9E0C17;
}

.portfolio-hero__sparkle svg {
  width: 15px;
  height: 15px;
}

.portfolio-hero__eyebrow {
  color: #9E0C17;
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.portfolio-hero__title {
  margin: 0 0 16px;
  color: #0f172a;
  font-size: clamp(2.2rem, 3.8vw, 3.4rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.portfolio-hero__title-accent {
  color: #9E0C17;
}

.portfolio-hero__desc {
  margin: 0 0 28px;
  color: #475569;
  font-size: 16px;
  line-height: 1.65;
  max-width: 680px;
}

/* Metric Pills */
.portfolio-hero__pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.portfolio-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 9999px;
  padding: 8px 18px;
  background: #fafafa;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 13.5px;
}

.portfolio-hero__pill svg {
  width: 16px;
  height: 16px;
  color: #9E0C17;
  flex-shrink: 0;
}

.portfolio-hero__pill strong {
  font-weight: 750;
  color: #0f172a;
}

/* --------------------------------------------------------------------------
   2. Filter Navigation Bar
   -------------------------------------------------------------------------- */
.portfolio-gallery {
  padding: clamp(48px, 6vw, 84px) 0;
  background: #ffffff;
}

.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(36px, 4vw, 52px);
}

.portfolio-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 9999px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  outline: none;
  transition: all 180ms ease;
  user-select: none;
}

.portfolio-filter-btn:hover {
  border-color: #cbd5e1;
  color: #0f172a;
  background: #f8fafc;
}

.portfolio-filter-btn.is-active {
  background: #9E0C17;
  border-color: #9E0C17;
  color: #ffffff;
  box-shadow: 0 4px 14px rgb(158 12 23 / 0.2);
}

/* --------------------------------------------------------------------------
   3. Symmetrical 3-Column Portfolio Grid
   -------------------------------------------------------------------------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 32px);
  align-items: stretch;
}

.portfolio-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e8e8e8;
  border-radius: 22px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 4px 20px rgb(15 23 42 / 0.04);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  border-color: #cbd5e1;
  box-shadow: 0 16px 36px rgb(15 23 42 / 0.08);
}

/* Thumbnail */
.portfolio-card__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f8fafc;
}

.portfolio-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card:hover .portfolio-card__thumb img {
  transform: scale(1.04);
}

.portfolio-card__category-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  border-radius: 8px;
  padding: 4px 10px;
  background: rgb(15 23 42 / 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Card Body */
.portfolio-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.portfolio-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.portfolio-card__logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: 28px;
  max-width: 130px;
}

.portfolio-card__logo {
  display: block;
  max-height: 26px;
  width: auto;
  object-fit: contain;
}

.portfolio-card__logo-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: #fff5f5;
  border: 1px solid #fee2e2;
  color: #9E0C17;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.portfolio-card__title {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.portfolio-card__desc {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.portfolio-card__footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
}

.portfolio-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9E0C17;
  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease;
}

.portfolio-card__btn-arrow {
  transition: transform 160ms ease;
}

.portfolio-card__btn:hover .portfolio-card__btn-arrow {
  transform: translateX(4px);
}

/* Empty State */
.portfolio-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed #e2e8f0;
  border-radius: 20px;
}

.portfolio-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff5f5;
  color: #9E0C17;
  margin-bottom: 16px;
}

.portfolio-empty__icon svg {
  width: 28px;
  height: 28px;
}

.portfolio-empty h3 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
  color: #0f172a;
}

.portfolio-empty p {
  margin: 0 0 20px;
  color: #64748b;
  font-size: 14.5px;
  max-width: 440px;
}

/* --------------------------------------------------------------------------
   4. Client Trust Logo Grid
   -------------------------------------------------------------------------- */
.portfolio-clients {
  padding: clamp(56px, 6vw, 80px) 0;
  background: #fafafa;
  border-top: 1px solid #f1f5f9;
}

.portfolio-clients__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(32px, 4vw, 44px);
}

.portfolio-clients__eyebrow {
  margin: 0 0 8px;
  color: #9E0C17;
  font-size: 12.5px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portfolio-clients__title {
  margin: 0;
  color: #0f172a;
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.portfolio-clients__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.portfolio-clients__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 14px 20px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 8px rgb(15 23 42 / 0.02);
  transition: transform 160ms ease, border-color 160ms ease;
}

.portfolio-clients__item:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.portfolio-clients__item img {
  display: block;
  max-height: 38px;
  max-width: 130px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 200ms ease, opacity 200ms ease;
}

.portfolio-clients__item:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   5. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  .portfolio-clients__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .portfolio-hero {
    padding: 36px 0 32px;
  }
  .portfolio-hero__pills {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .portfolio-hero__pill {
    width: 100%;
    justify-content: center;
  }
  .portfolio-gallery {
    padding: 36px 0 52px;
  }
  .portfolio-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    margin-bottom: 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .portfolio-filters::-webkit-scrollbar {
    display: none;
  }
  .portfolio-filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 38px;
    padding: 0 16px;
    font-size: 13px;
  }
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .portfolio-card__body {
    padding: 18px 20px 20px;
  }
  .portfolio-clients {
    padding: 44px 0 56px;
  }
  .portfolio-clients__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .portfolio-clients__item {
    min-height: 68px;
    padding: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-filter-btn,
  .portfolio-card,
  .portfolio-card__thumb img,
  .portfolio-card__btn,
  .portfolio-card__btn-arrow,
  .portfolio-clients__item,
  .portfolio-clients__item img {
    transition: none !important;
  }
}
