/* ============================================================
   /case-studies, and the "More case studies" strip on each case page

   Built on css/system.css. Both come from scripts/build-case-studies.py,
   from one list, so a card and its strip entry always agree. Every card
   leads with the number the case moved, then the story's own headline.
   The whole card is the link: the title's anchor stretches over it.

   One 1240px wrap, like every other page.
   ============================================================ */

.cx { font-family: var(--pt-font); color: var(--pt-ink); }
.cx-wrap { width: 100%; max-width: var(--pt-maxw); margin-inline: auto; }

/* ---------- head band ---------- */
.cx-head {
  position: relative; overflow: hidden;
  /* the nav floats over this band (css/nav.css), so its height comes first */
  padding: calc(var(--nav-h, 103px) + clamp(28px, 4vw, 60px)) var(--pt-gutter) clamp(40px, 4.5vw, 64px);
}
.cx-head::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(36% 80% at 88% 20%, rgba(77, 83, 196, 0.11), transparent 72%),
    radial-gradient(28% 60% at 0% 100%, rgba(220, 185, 88, 0.14), transparent 70%);
}
.cx-head .cx-wrap { position: relative; z-index: 1; }
.cx-head .pt-eyebrow { margin-bottom: 20px; }
.cx-head h1 {
  font-size: var(--pt-fs-display); font-weight: 700; line-height: 1.02; letter-spacing: -0.025em;
  margin: 0 0 20px; max-width: 15ch; text-wrap: balance; color: var(--pt-ink);
}
.cx-lead { font-size: var(--pt-fs-lead); line-height: 1.55; color: var(--pt-ink-muted); margin: 0; max-width: 62ch; }
.cx-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.cx-jump a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
  font-size: 13px; font-weight: 600; line-height: 1; color: var(--pt-ink-muted); text-decoration: none;
  background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: var(--pt-r-pill);
  transition: border-color var(--pt-fast) var(--pt-ease), color var(--pt-fast) var(--pt-ease);
}
.cx-jump a span { font-family: var(--pt-mono); font-size: 11px; font-weight: 500; color: var(--pt-ink-soft); }
.cx-jump a:hover { border-color: var(--pt-primary); color: var(--pt-primary); }
.cx-jump a:focus-visible { outline: 2px solid var(--pt-primary); outline-offset: 2px; }

/* ---------- groups ---------- */
.cx-group {
  padding: clamp(48px, 6vw, 88px) var(--pt-gutter);
  border-top: 1px solid var(--pt-border);
  scroll-margin-top: var(--nav-h, 81px);
}
.cx-group:nth-of-type(odd) { background: var(--pt-surface); }
.cx-group-head { max-width: 760px; margin: 0 0 32px; }
.cx-n {
  display: inline-flex; align-items: center; gap: 12px; margin: 0 0 14px;
  font-family: var(--pt-mono); font-size: var(--pt-fs-eyebrow); font-weight: 500;
  letter-spacing: 0.12em; color: var(--pt-primary);
}
.cx-n::before { content: ""; width: 24px; height: 1px; background: currentColor; opacity: .7; }
.cx-group-head h2 {
  font-size: var(--pt-fs-h2); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em;
  margin: 0 0 12px; color: var(--pt-ink); text-wrap: balance;
}
.cx-group-lead { font-size: 17px; line-height: 1.6; color: var(--pt-ink-muted); margin: 0; max-width: 62ch; }

.cx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cx-grid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-grid.n1 { grid-template-columns: minmax(0, 1fr); }

/* ---------- the card ---------- */
.cx-card {
  position: relative; display: flex; flex-direction: column; gap: 18px;
  padding: 24px 24px 22px; background: var(--pt-canvas);
  border: 1px solid var(--pt-border); border-radius: var(--pt-r-card);
  transition: transform var(--pt-slow) var(--pt-ease), box-shadow var(--pt-slow) var(--pt-ease), border-color var(--pt-fast) var(--pt-ease);
}
.cx-group:nth-of-type(even) .cx-card { background: var(--pt-surface); box-shadow: var(--pt-shadow-card); }
.cx-card:hover { transform: translateY(-4px); box-shadow: var(--pt-shadow-lift); border-color: var(--pt-border-strong); }
.cx-card:focus-within { outline: 2px solid var(--pt-primary); outline-offset: 3px; }
.cx-top { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.cx-top img { display: block; height: 26px; width: auto; max-width: 150px; object-fit: contain; object-position: left center; }
.cx-kick {
  margin: 0; font-family: var(--pt-mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--pt-ink-soft);
}
.cx-fig { display: grid; gap: 6px; }
.cx-num {
  margin: 0; font-size: var(--pt-fs-stat); font-weight: 700; line-height: 1; letter-spacing: -0.02em;
  color: var(--pt-primary); font-variant-numeric: tabular-nums;
}
.cx-label { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--pt-ink); }
.cx-also { margin: 2px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--pt-ink-soft); }
.cx-body { display: flex; flex-direction: column; gap: 14px; flex: 1; padding-top: 16px; border-top: 1px solid var(--pt-border); }
.cx-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; color: var(--pt-ink); }
.cx-title a { color: inherit; text-decoration: none; }
/* the title's link covers the whole card */
.cx-title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cx-title a:focus-visible { outline: none; }
.cx-desc { margin: 0; font-size: 16px; line-height: 1.6; color: var(--pt-ink-muted); max-width: 62ch; }
.cx-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.cx-meta { margin: 0; font-size: 13.5px; color: var(--pt-ink-soft); }
.cx-read { font-size: 14px; font-weight: 600; color: var(--pt-primary); white-space: nowrap; }
/* drawn by CSS, so the markdown twin gets the title link and not a stray "Read the case" */
.cx-read::after { content: "Read the case \2192"; }
.cx-card:hover .cx-read { color: var(--pt-primary-hover); }

/* a group with one case gets a wide card: story on the left, the number on the right */
.cx-card.wide {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  grid-template-areas: "top fig" "body fig"; gap: 18px clamp(32px, 5vw, 72px);
  padding: clamp(24px, 3vw, 36px) clamp(24px, 3vw, 40px);
}
.cx-card.wide .cx-top { grid-area: top; }
.cx-card.wide .cx-body { grid-area: body; border-top: 0; padding-top: 0; }
.cx-card.wide .cx-title { font-size: clamp(20px, 2vw, 24px); line-height: 1.3; }
.cx-card.wide .cx-fig {
  grid-area: fig; align-self: stretch; align-content: center;
  padding-left: clamp(24px, 3vw, 40px); border-left: 1px solid var(--pt-border);
}
.cx-card.wide .cx-num { font-size: clamp(44px, 5vw, 64px); }
.cx-card.wide .cx-label { font-size: 16px; }

/* ---------- testimonials ----------
   The homepage quotes, word for word (the builder reads them from there).
   A quote from a case study links to it from the attribution row. */
.cx-says .pt-eyebrow { margin: 0 0 14px; }
.cx-quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cx-quote {
  display: flex; flex-direction: column; gap: 22px; margin: 0;
  padding: clamp(24px, 3vw, 32px); background: var(--pt-canvas);
  border: 1px solid var(--pt-border); border-radius: var(--pt-r-card);
}
.cx-group:nth-of-type(even) .cx-quote { background: var(--pt-surface); box-shadow: var(--pt-shadow-card); }
.cx-quote blockquote { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; }
.cx-pull {
  margin: 0; font-size: clamp(19px, 1.6vw, 21px); font-weight: 700; line-height: 1.35;
  letter-spacing: -0.01em; color: var(--pt-ink); text-wrap: pretty;
}
.cx-qbody { margin: 0; font-size: var(--pt-fs-card); line-height: 1.65; color: var(--pt-ink-muted); }
.cx-qby {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; text-align: left;  /* Webflow centres figcaption */
  margin-top: auto; padding-top: 18px; border-top: 1px solid var(--pt-border);
}
.cx-qby img { display: block; width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.cx-qwho { display: grid; gap: 2px; }
.cx-qname { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--pt-ink); }
.cx-qrole { font-size: 13.5px; line-height: 1.4; color: var(--pt-ink-soft); }
.cx-qcase { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--pt-primary); text-decoration: none; }
.cx-qcase::after { content: " \2192"; }
.cx-qcase:hover { color: var(--pt-primary-hover); }
.cx-qcase:focus-visible { outline: 2px solid var(--pt-primary); outline-offset: 3px; border-radius: 4px; }
.cx-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the close ---------- */
.cx-close-band { padding: var(--pt-section) var(--pt-gutter); border-top: 1px solid var(--pt-border); }
.cx-close {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: end;
  padding: clamp(36px, 5vw, 64px);
}
.cx-close h2 {
  font-size: var(--pt-fs-h2); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em;
  margin: 0; color: var(--pt-ink-on-dark); text-wrap: balance;
}
.cx-close p:not(.pt-eyebrow) { font-size: 17px; line-height: 1.65; color: var(--pt-ink-on-dark-muted); margin: 0 0 24px; }

/* ---------- "More case studies", at the end of each case page ----------
   Selectors carry two classes so case-studies.css's .cs-section p and h2
   rules (reading size, 760px measure) don't reach into the cards. */
.cx-more .cx-more-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 20px; }
.cx-more .cx-more-head h2 { font-size: var(--pt-fs-h3); line-height: 1.2; letter-spacing: -0.01em; margin: 0; max-width: none; }
.cx-more .cx-all { font-size: 15px; font-weight: 600; color: var(--pt-primary); text-decoration: none; }
.cx-more .cx-all::after { content: " \2192"; }
.cx-more .cx-all:hover { color: var(--pt-primary-hover); }
.cx-more-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cx-more .cx-mini {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 18px;
  background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: var(--pt-r-tile);
  transition: transform var(--pt-slow) var(--pt-ease), box-shadow var(--pt-slow) var(--pt-ease), border-color var(--pt-fast) var(--pt-ease);
}
.cx-more .cx-mini:hover { transform: translateY(-3px); box-shadow: var(--pt-shadow-lift); border-color: var(--pt-border-strong); }
.cx-more .cx-mini:focus-within { outline: 2px solid var(--pt-primary); outline-offset: 3px; }
.cx-more .cx-mini img { display: block; height: 22px; width: auto; max-width: 120px; object-fit: contain; object-position: left center; margin-bottom: 4px; }
.cx-more .cx-num { margin: 0; max-width: none; font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--pt-primary); }
.cx-more .cx-label {
  margin: 0; max-width: none; font-size: 13.5px; font-weight: 500; line-height: 1.45; color: var(--pt-ink-muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cx-more .cx-mini-t { margin: auto 0 0; padding-top: 6px; font-size: 13.5px; font-weight: 700; line-height: 1.35; color: var(--pt-ink); }
.cx-more .cx-mini-t a { color: inherit; text-decoration: none; }
.cx-more .cx-mini-t a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cx-more .cx-mini-t a:focus-visible { outline: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .cx-more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .cx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cx-card.wide { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "fig" "body"; }
  .cx-card.wide .cx-fig { padding-left: 0; border-left: 0; }
  .cx-card.wide .cx-body { padding-top: 16px; border-top: 1px solid var(--pt-border); }
  .cx-quotes { grid-template-columns: minmax(0, 1fr); }
  .cx-close { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cx-grid, .cx-grid.n2 { grid-template-columns: minmax(0, 1fr); }
  .cx-more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-more .cx-num { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-card, .cx-more .cx-mini, .cx-jump a { transition: none; }
  .cx-card:hover, .cx-more .cx-mini:hover { transform: none; }
}
