/* ============================================
   PORTFOLIO — Paid Ads Case Studies
   Extends Monolithic Precision design system
   ============================================ */

/* ── Portfolio Hero ──────────────────────── */
.pf-hero {
  padding-top: 140px;
  padding-bottom: var(--stack-lg);
  text-align: center;
}

.pf-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  transition: color var(--dur) var(--ease), gap var(--dur) var(--ease);
}

.pf-hero__back:hover {
  color: var(--primary);
  gap: 8px;
}

.pf-hero__back svg {
  width: 14px;
  height: 14px;
}

.pf-hero__eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.pf-hero__heading {
  font-size: 56px;
  font-weight: 600;
  line-height: 60px;
  letter-spacing: -0.005em;
  color: var(--primary);
  margin-bottom: 16px;
}

.pf-hero__desc {
  font-size: 21px;
  font-weight: 400;
  line-height: 1.38;
  letter-spacing: 0.011em;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 48px;
}

/* Hero Stats Row */
.pf-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.pf-hero__stat {
  background: var(--surface-container-lowest);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--r-xl);
  padding: 28px 20px;
  transition: transform var(--dur) var(--ease);
}

.pf-hero__stat:hover {
  transform: scale(1.02);
}

.pf-hero__stat-value {
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin-bottom: 6px;
}

.pf-hero__stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* ── Filter Bar ──────────────────────────── */
.pf-filters-section {
  padding: var(--stack-md) 0 0;
}

.pf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.pf-filter-btn {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 8px 20px;
  border-radius: var(--r-full);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}

.pf-filter-btn:hover {
  border-color: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
}

.pf-filter-btn.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
}

/* ── Case Study Grid ─────────────────────── */
.pf-grid-section {
  padding: var(--stack-md) 0 var(--stack-lg);
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gutter);
}

.pf-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  font-size: 17px;
  display: none;
}

/* ── Case Study Card ─────────────────────── */
.pf-card {
  background: var(--surface-container-lowest);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--r-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--dur) var(--ease),
              opacity 0.35s var(--ease);
  position: relative;
}

.pf-card:hover {
  transform: scale(1.02);
}

.pf-card--hidden {
  display: none;
}

.pf-card--featured {
  border-top: 2px solid var(--system-blue);
}

/* Card Header */
.pf-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pf-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.pf-card__icon svg {
  width: 20px;
  height: 20px;
}

.pf-card__industry {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}

/* Tags Row */
.pf-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pf-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  white-space: nowrap;
}

.pf-tag--leadgen {
  color: #0066CC;
  background: rgba(0, 102, 204, 0.06);
  border-color: rgba(0, 102, 204, 0.12);
}

.pf-tag--ecommerce {
  color: #34A853;
  background: rgba(52, 168, 83, 0.06);
  border-color: rgba(52, 168, 83, 0.12);
}

.pf-tag--engagement {
  color: #AF52DE;
  background: rgba(175, 82, 222, 0.06);
  border-color: rgba(175, 82, 222, 0.12);
}

.pf-tag--meta {
  color: #0081FB;
  background: rgba(0, 129, 251, 0.06);
  border-color: rgba(0, 129, 251, 0.12);
}

.pf-tag--google {
  color: #EA4335;
  background: rgba(234, 67, 53, 0.06);
  border-color: rgba(234, 67, 53, 0.12);
}

/* Card Gallery & Screenshots */
.pf-card__gallery {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pf-gallery-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding-bottom: 4px;
}

.pf-gallery-tab {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.pf-gallery-tab:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.pf-gallery-tab.active {
  color: var(--system-blue);
  background: rgba(0, 102, 204, 0.05);
}

.pf-gallery-views {
  position: relative;
}

.pf-gallery-view {
  display: none;
}

.pf-gallery-view.active {
  display: block;
}

.pf-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--bg-secondary);
  cursor: zoom-in;
  display: block;
}

.pf-image-wrapper img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform var(--dur) var(--ease);
}

.pf-image-wrapper--dashboard img {
  object-fit: contain;
  padding: 8px;
  background: var(--bg-secondary);
}

.pf-image-wrapper:hover img {
  transform: scale(1.02);
}

/* Blur Mask Overlay */
.pf-image-blur-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 10;
}

/* Dynamic Brand Blur Masks */
/* Covers the top sponsor name area on ad creative screenshots */
.pf-image-wrapper--creative::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 22%; 
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 5;
  pointer-events: none;
}

/* Lightbox Modal */
.pf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

.pf-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.pf-lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pf-lightbox__wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}

.pf-lightbox__wrapper img {
  max-width: 90vw;
  max-height: 80vh;
  display: block;
}

.pf-lightbox__close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.pf-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.pf-lightbox__close svg {
  width: 20px;
  height: 20px;
}

/* Primary Metric Highlight */
.pf-card__highlight {
  padding: 16px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.pf-card__primary-value {
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--primary);
  margin-bottom: 4px;
}

.pf-card__primary-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* Secondary Metrics Grid */
.pf-card__metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pf-card__metric {
  padding: 8px 0;
}

.pf-card__metric-value {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.pf-card__metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Card Description */
.pf-card__desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ── Methodology Section ─────────────────── */
.pf-method-section {
  padding: var(--stack-lg) 0;
  background: var(--bg-secondary);
}

.pf-method__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: var(--stack-md);
}

.pf-method__step {
  background: var(--surface-container-lowest);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--r-xl);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  transition: transform var(--dur) var(--ease);
}

.pf-method__step:hover {
  transform: translateY(-4px);
}

.pf-method__number {
  font-size: 48px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.04);
  line-height: 1;
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.pf-method__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--system-blue);
}

.pf-method__icon svg {
  width: 22px;
  height: 22px;
}

.pf-method__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.pf-method__desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ── Trust Signals ───────────────────────── */
.pf-trust-section {
  padding: var(--stack-lg) 0;
}

.pf-trust__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: var(--stack-md);
  max-width: 800px;
}

.pf-trust__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-radius: var(--r-lg);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform var(--dur) var(--ease);
}

.pf-trust__item:hover {
  transform: scale(1.01);
}

.pf-trust__check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #34C759;
  margin-top: 1px;
}

.pf-trust__text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

/* ── CTA Section ─────────────────────────── */
.pf-cta-section {
  padding: var(--stack-lg) 0;
  background: var(--bg-secondary);
}

.pf-cta__card {
  background: var(--primary);
  border-radius: var(--r-xl);
  padding: 64px 40px;
  text-align: center;
  color: var(--on-primary);
}

.pf-cta__heading {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  color: var(--on-primary);
}

.pf-cta__desc {
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  max-width: 520px;
  margin: 0 auto 32px;
}

.pf-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--r-full);
  background: var(--on-primary);
  color: var(--primary);
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.pf-cta__btn:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.pf-cta__btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur) var(--ease);
}

.pf-cta__btn:hover svg {
  transform: translateX(3px);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 1024px) {
  .pf-hero__heading {
    font-size: 44px;
    line-height: 48px;
  }

  .pf-hero__stats {
    grid-template-columns: repeat(2, 1fr);
    max-width: 500px;
  }

  .pf-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pf-method__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pf-hero {
    padding-top: 110px;
    padding-bottom: 40px;
  }

  .pf-hero__heading {
    font-size: 32px;
    line-height: 36px;
    letter-spacing: 0;
  }

  .pf-hero__desc {
    font-size: 17px;
    margin-bottom: 32px;
  }

  .pf-hero__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .pf-hero__stat {
    padding: 20px 16px;
  }

  .pf-hero__stat-value {
    font-size: 28px;
  }

  .pf-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .pf-filters::-webkit-scrollbar {
    display: none;
  }

  .pf-grid {
    grid-template-columns: 1fr;
  }

  .pf-method__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pf-trust__grid {
    grid-template-columns: 1fr;
  }

  .pf-cta__card {
    padding: 40px 24px;
  }

  .pf-cta__heading {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .pf-hero__stats {
    grid-template-columns: 1fr 1fr;
  }

  .pf-card {
    padding: 24px;
  }

  .pf-card__primary-value {
    font-size: 28px;
  }
}
