/* DevScripty Case Studies — frontend. All classes are scoped with ds-pf-*.
   Fonts (Playfair Display / Plus Jakarta Sans) are inherited from the site; nothing is loaded here. */

.ds-pf {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #3D3B38;
}

.ds-pf *,
.ds-pf *::before,
.ds-pf *::after,
.ds-pf-modal-backdrop *,
.ds-pf-modal-backdrop *::before,
.ds-pf-modal-backdrop *::after {
  box-sizing: border-box;
}

/* ---------- Filters ---------- */
.ds-pf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
  margin: 0 0 28px;
}

.ds-pf-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ds-pf-filter-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #867258;
  margin-right: 4px;
}

.ds-pf .ds-pf-pill {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #1A1A1A;
  background: #FFFFFF;
  border: 1px solid #E2D9CD;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: none;
  text-transform: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ds-pf .ds-pf-pill:hover {
  border-color: #9E886D;
  color: #867258;
  background: #FFFFFF;
}

.ds-pf .ds-pf-pill.is-active,
.ds-pf .ds-pf-pill.is-active:hover {
  background: #1A1A1A;
  border-color: #1A1A1A;
  color: #FFFFFF;
}

.ds-pf .ds-pf-pill:focus-visible,
.ds-pf-modal-close:focus-visible,
.ds-pf-modal-btn:focus-visible,
.ds-pf-pill-link:focus-visible {
  outline: 2px solid #867258;
  outline-offset: 2px;
}

/* ---------- Grid ---------- */
.ds-pf-grid {
  display: grid;
  grid-template-columns: repeat(var(--ds-pf-cols, 2), minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* ---------- Card ---------- */
.ds-pf-card {
  background-color: #FAF8F5;
  border: 1px solid #E8E2D9;
  border-radius: 20px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.ds-pf-card[hidden] {
  display: none;
}

.ds-pf-card:hover {
  transform: translateY(-4px);
  background-color: #FFFFFF;
  border-color: #9E886D;
  box-shadow: 0 18px 40px rgba(26, 26, 26, 0.05);
}

.ds-pf-card:focus-visible {
  outline: 2px solid #867258;
  outline-offset: 3px;
}

.ds-pf-card.is-entering {
  animation: dsPfCardIn 0.35s ease both;
}

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

.ds-pf-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ds-pf-role {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #867258;
}

.ds-pf-pill-link {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  text-decoration: none;
  background-color: #FFFFFF;
  border: 1px solid #E2D9CD;
  padding: 5px 12px;
  border-radius: 999px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ds-pf-pill-link:hover {
  background-color: #1A1A1A;
  color: #FFFFFF;
  border-color: #1A1A1A;
}

.ds-pf-pill-badge {
  font-size: 12px;
  font-weight: 600;
  color: #55524E;
  background-color: #F0ECE5;
  padding: 5px 12px;
  border-radius: 999px;
}

.ds-pf-card .ds-pf-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 14px;
  padding: 0;
  color: #1A1A1A;
  transition: color 0.3s ease;
}

.ds-pf-card:hover .ds-pf-title {
  color: #867258;
}

.ds-pf-card .ds-pf-desc {
  font-size: 14.5px;
  line-height: 1.6;
  color: #55524E;
  margin: 0 0 14px;
}

.ds-pf-card .ds-pf-list {
  margin: 0 0 22px;
  padding-left: 18px;
  color: #3D3B38;
  font-size: 14px;
  line-height: 1.6;
}

.ds-pf-list li {
  margin-bottom: 8px;
}

.ds-pf-list li::marker {
  color: #867258;
}

.ds-pf-list code,
.ds-pf-modal-section code {
  font-size: 0.92em;
  background: #EFECE6;
  padding: 1px 6px;
  border-radius: 5px;
}

.ds-pf-bottom {
  margin-top: auto;
}

.ds-pf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ds-pf-tag {
  font-size: 12px;
  font-weight: 600;
  color: #55524E;
  background-color: #FFFFFF;
  border: 1px solid #E4DDD3;
  padding: 5px 11px;
  border-radius: 8px;
}

.ds-pf-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid #EBE5DC;
  flex-wrap: wrap;
}

.ds-pf-lead {
  font-size: 13px;
  color: #6E6A65;
}

.ds-pf-lead strong {
  color: #1A1A1A;
  font-weight: 700;
}

.ds-pf-cta {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: #867258;
  transition: color 0.2s ease, transform 0.2s ease;
}

.ds-pf-card:hover .ds-pf-cta {
  color: #1A1A1A;
  transform: translateX(3px);
}

/* ---------- Modal ---------- */
.ds-pf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 99999;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ds-pf-modal-backdrop.is-open {
  display: flex;
}

.ds-pf-modal-window {
  background: #FAF8F5;
  border: 1px solid #E2D9CD;
  border-radius: 24px;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 38px 36px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  animation: dsPfModalIn 0.22s ease;
}

.ds-pf-modal-window:focus {
  outline: none;
}

@keyframes dsPfModalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ds-pf-modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #E2D9CD;
  background: #FFFFFF;
  color: #1A1A1A;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ds-pf-modal-close:hover {
  background: #1A1A1A;
  color: #FFFFFF;
}

.ds-pf-modal-kicker {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #867258;
  margin-bottom: 10px;
  padding-right: 44px;
}

.ds-pf-modal-window .ds-pf-modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: #1A1A1A;
  margin: 0 0 18px;
  padding: 0 36px 0 0;
  line-height: 1.25;
}

.ds-pf-modal-metrics {
  display: grid;
  grid-template-columns: repeat(var(--ds-pf-metrics, 3), minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.ds-pf-modal-metric-box {
  background: #FFFFFF;
  border: 1px solid #E8E2D9;
  border-radius: 14px;
  padding: 14px 16px;
}

.ds-pf-modal-metric-val {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: #1A1A1A;
}

.ds-pf-modal-metric-lbl {
  display: block;
  font-size: 12px;
  color: #6E6A65;
  margin-top: 2px;
}

.ds-pf-modal-section {
  margin-bottom: 18px;
}

.ds-pf-modal-window .ds-pf-modal-section h4 {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #867258;
  margin: 0 0 6px;
}

.ds-pf-modal-window .ds-pf-modal-section p {
  font-size: 14.5px;
  line-height: 1.65;
  color: #3D3B38;
  margin: 0;
}

.ds-pf-modal-section p + p {
  margin-top: 10px;
}

.ds-pf-tags--modal {
  margin: 18px 0 0;
}

.ds-pf-modal-actions {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #E8E2D9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ds-pf-modal-btn {
  background: #1A1A1A;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.ds-pf-modal-btn:hover {
  background: #867258;
  color: #FFFFFF;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .ds-pf-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 600px) {
  .ds-pf-modal-window {
    padding: 28px 22px;
  }
  .ds-pf-modal-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ds-pf-card {
    padding: 24px 20px;
  }
  .ds-pf-card .ds-pf-title {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ds-pf-card,
  .ds-pf-cta,
  .ds-pf-card.is-entering,
  .ds-pf-modal-window {
    transition: none;
    animation: none;
  }
  .ds-pf-card:hover {
    transform: none;
  }
}