/* Portfolio listing + detail modal */

.pf-list-section {
  background: #fff;
}

.pf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}

.pf-filter {
  appearance: none;
  border: 1px solid rgba(11, 18, 32, 0.12);
  background: #fff;
  color: rgba(11, 18, 32, 0.78);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.pf-filter:hover,
.pf-filter:focus-visible {
  border-color: rgba(11, 18, 32, 0.28);
  color: #0b1220;
}

.pf-filter.is-active {
  background: #0b1220;
  border-color: #0b1220;
  color: #fff;
}

.pf-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px;
  margin-top: 36px;
}

.pf-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(11, 18, 32, 0.1);
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 14px 40px rgba(11, 18, 32, 0.06);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.pf-grid[data-remainder="2"] .pf-card.is-last-two {
  grid-column: span 3;
}

.pf-grid[data-remainder="1"] .pf-card.is-last-one,
.pf-grid[data-count="1"] .pf-card.is-last-one {
  grid-column: 1 / -1;
}

.pf-card.is-filtered-out {
  display: none;
}

.pf-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px rgba(11, 18, 32, 0.1);
}

.pf-card-media {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0b1220;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.pf-card-image,
.pf-card-media img,
.pf-card-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.pf-card:hover .pf-card-image,
.pf-card:hover .pf-card-media img,
.pf-card:hover .pf-card-media video {
  transform: scale(1.04);
}

.pf-card-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 220px;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(145deg, #1a2744 0%, #0b1220 100%);
}

.pf-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 22px 22px 24px;
  min-width: 0;
}

.pf-card-tag {
  display: inline-flex;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.06);
  color: rgba(11, 18, 32, 0.72);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pf-card-title {
  margin: 0;
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.pf-card-excerpt {
  margin: 0;
  color: rgba(11, 18, 32, 0.72);
  font-size: 15px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pf-card-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue, #1d4ed8);
  font-weight: 650;
  cursor: pointer;
}

.pf-card-cta:hover,
.pf-card-cta:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pf-empty-filter,
.pf-list-empty {
  margin-top: 48px;
  padding: 48px 36px;
  border: 1px solid var(--line, rgba(0, 0, 0, 0.1));
  border-radius: 28px;
  text-align: center;
  color: rgba(11, 18, 32, 0.72);
}

.pf-list-empty h3 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.02em;
  color: #0b1220;
}

.pf-list-empty p {
  max-width: 460px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* Modal — dark theme, clean layout */
.pf-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overscroll-behavior: contain;
}

.pf-modal:not(.is-open),
.pf-modal:not(.is-open) * {
  pointer-events: none !important;
}

.pf-modal.is-open {
  visibility: visible;
  pointer-events: auto;
}

.pf-modal.is-visible {
  opacity: 1;
}

.pf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pf-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-height: min(86vh, 860px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 92% 8%, rgba(132, 59, 223, 0.22) 0%, transparent 42%),
    linear-gradient(150deg, #12143f 0%, #0b0c38 48%, #090a31 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  transform: translateY(24px) scale(0.98);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.pf-modal.is-visible .pf-modal-dialog {
  transform: translateY(0) scale(1);
}

.pf-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.pf-modal-close:hover,
.pf-modal-close:focus-visible {
  background: var(--red, #cd0f36);
  border-color: var(--red, #cd0f36);
}

.pf-modal-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 36px 36px 40px;
  -webkit-overflow-scrolling: touch;
}

.pf-modal-head {
  /* Defensive: site-wide `header { position: fixed }` must never apply here */
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  width: auto;
  max-width: none;
  padding: 0 48px 0 0 !important;
  margin: 0 0 28px;
}

.pf-modal-industry {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pf-modal-title {
  margin: 14px 0 0;
  font-family: var(--font-display, inherit);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
}

.pf-modal-excerpt {
  margin: 12px 0 0;
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  line-height: 1.6;
}

.pf-modal-sections {
  --pf-marker-size: 36px;
  --pf-rail-gap: 18px;
  position: relative;
  display: grid;
  gap: 0;
}

.pf-modal-sections.has-timeline::before {
  content: "";
  position: absolute;
  top: calc(var(--pf-marker-size) / 2);
  bottom: calc(var(--pf-marker-size) / 2);
  left: calc(var(--pf-marker-size) / 2);
  width: 1px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%);
  pointer-events: none;
}

.pf-modal-section {
  position: relative;
  display: grid;
  grid-template-columns: var(--pf-marker-size) minmax(0, 1fr);
  column-gap: var(--pf-rail-gap);
  align-items: start;
  padding-bottom: 28px;
}

.pf-modal-section:last-child {
  padding-bottom: 0;
}

.pf-modal-section-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--pf-marker-size);
  height: var(--pf-marker-size);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #11133a;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 4px #0d0e35;
}

.pf-modal-section-content {
  min-width: 0;
  padding-top: 6px;
}

.pf-modal-section h3 {
  margin: 0 0 10px;
  font-family: var(--font-display, inherit);
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #fff;
}

.pf-modal-section-body {
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 1.65;
}

.pf-modal-section-body p {
  margin: 0 0 12px;
}

.pf-modal-section-body p:last-child {
  margin-bottom: 0;
}

.pf-modal-section-body ul,
.pf-modal-section-body ol {
  margin: 0 0 12px;
  padding-left: 1.25em;
}

.pf-modal-section-body li {
  margin: 0 0 8px;
}

.pf-modal-section-body a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pf-modal-section-body strong {
  color: #fff;
}

body.pf-modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .pf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pf-card,
  .pf-grid[data-remainder="1"] .pf-card.is-last-one,
  .pf-grid[data-remainder="2"] .pf-card.is-last-two,
  .pf-grid[data-count="1"] .pf-card.is-last-one {
    grid-column: span 1;
  }

  .pf-grid[data-odd="1"] .pf-card.is-odd-last {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .pf-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .pf-card,
  .pf-grid[data-remainder="1"] .pf-card.is-last-one,
  .pf-grid[data-remainder="2"] .pf-card.is-last-two,
  .pf-grid[data-count="1"] .pf-card.is-last-one,
  .pf-grid[data-odd="1"] .pf-card.is-odd-last {
    grid-column: 1 / -1;
  }

  .pf-card-body {
    padding: 18px 18px 20px;
  }

  .pf-modal {
    padding: 12px;
  }

  .pf-modal-scroll {
    padding: 28px 20px 30px;
  }

  .pf-modal-sections {
    --pf-marker-size: 32px;
    --pf-rail-gap: 14px;
  }

  .pf-modal-title {
    font-size: clamp(24px, 7vw, 32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-card,
  .pf-card-image,
  .pf-card-media img,
  .pf-card-media video,
  .pf-modal,
  .pf-modal-dialog {
    transition: none !important;
  }

  .pf-card:hover {
    transform: none;
  }

  .pf-card:hover .pf-card-image,
  .pf-card:hover .pf-card-media img,
  .pf-card:hover .pf-card-media video {
    transform: none;
  }

  .pf-modal-dialog {
    transform: none;
  }
}
