/*=============================================
=              Case Studies page              =
=============================================*/
.cs-hero,
.cs-featured,
.cs-all,
.cs-cta {
  --cs-ink: #1d1838;
  --cs-body: #5d5872;
  --cs-brand: #805dcd;
  --cs-brand-strong: #6340b5;
  --cs-soft: #eee7ff;
  --cs-line: #e5e0f1;
  --cs-tint: #f7f5fc;
  --cs-night: #140d2e;
  --cs-night-2: #2d1a66;
}

.cs-eyebrow {
  margin: 0 0 14px;
  color: var(--cs-brand-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cs-eyebrow--light {
  color: #cdb8ff;
}

.cs-featured h2,
.cs-all h2,
.cs-cta h2 {
  margin: 0;
  color: var(--cs-ink);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.cs-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--cs-brand-strong);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.cs-link:hover {
  color: var(--cs-brand);
}

/* Hero */
.cs-hero {
  padding: 150px 0 72px;
  background:
    radial-gradient(circle at 85% 15%, rgba(128, 93, 205, 0.55), transparent 45%),
    radial-gradient(circle at 5% 100%, rgba(128, 93, 205, 0.25), transparent 40%),
    linear-gradient(135deg, var(--cs-night), var(--cs-night-2));
  color: rgba(255, 255, 255, 0.84);
}

.cs-hero h1 {
  max-width: 820px;
  margin: 0 0 20px;
  color: #fff;
  font-size: clamp(38px, 5.4vw, 68px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.cs-hero h1 span {
  background: linear-gradient(90deg, #cdb8ff, #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cs-hero__lead {
  max-width: 640px;
  margin: 0 0 44px;
  font-size: 19px;
  line-height: 1.6;
}

.cs-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 820px;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.cs-hero__stats > div {
  display: flex;
  flex-direction: column;
  padding: 22px 20px 0 0;
}

.cs-hero__stats dd {
  order: 1;
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 700;
  line-height: 1.1;
}

.cs-hero__stats dt {
  order: 2;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14.5px;
  font-weight: 500;
}

/* Featured */
.cs-featured {
  padding: 96px 0 48px;
  background: #fff;
}

.cs-featured__head,
.cs-all__head {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 36px;
}

.cs-featured__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 24px;
}

.cs-feat {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cs-line);
  border-radius: 20px;
  background: #fff;
  color: var(--cs-body);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cs-feat:hover {
  color: var(--cs-body);
  box-shadow: 0 24px 48px rgba(40, 30, 80, 0.14);
  transform: translateY(-5px);
}

.cs-feat img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s ease;
}

.cs-feat:hover img {
  transform: scale(1.03);
}

.cs-feat__body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 24px;
  background: #fff;
}

.cs-feat__stat {
  color: var(--cs-brand-strong);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.cs-feat strong {
  margin: 4px 0 6px;
  color: var(--cs-ink);
  font-size: 20px;
  font-weight: 600;
}

.cs-feat__body > span:not(.cs-feat__stat):not(.cs-feat__cta) {
  font-size: 15.5px;
  line-height: 1.55;
}

/* The lead story spans both rows, with its text over a dark panel */
.cs-feat--lead {
  grid-row: 1 / 3;
  border-color: transparent;
  background: linear-gradient(160deg, var(--cs-night), var(--cs-night-2));
}

.cs-feat--lead img {
  aspect-ratio: 16 / 9;
}

.cs-feat--lead .cs-feat__body {
  justify-content: center;
  padding: 30px 32px 34px;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
}

.cs-feat--lead .cs-feat__stat {
  color: #cdb8ff;
  font-size: 46px;
}

.cs-feat--lead strong {
  color: #fff;
  font-size: 28px;
}

.cs-feat--lead .cs-feat__body > span:not(.cs-feat__stat):not(.cs-feat__cta) {
  font-size: 17px;
}

.cs-feat__cta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 18px;
  color: #fff;
  font-weight: 600;
}

/* All work */
.cs-all {
  padding: 48px 0 104px;
  background: #fff;
}

.cs-search {
  position: relative;
  display: block;
  width: min(100%, 320px);
  margin: 0;
}

.cs-search i {
  position: absolute;
  top: 50%;
  left: 16px;
  color: var(--cs-body);
  transform: translateY(-50%);
}

.cs-search input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--cs-line);
  border-radius: 30px;
  background: var(--cs-tint);
  color: var(--cs-ink);
  font-size: 15px;
}

.cs-search input:focus {
  border-color: var(--cs-brand);
  outline: 3px solid rgba(128, 93, 205, 0.2);
  background: #fff;
}

.cs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.cs-filters button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--cs-line);
  border-radius: 30px;
  background: #fff;
  color: var(--cs-body);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cs-filters button span {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--cs-tint);
  color: var(--cs-brand-strong);
  font-size: 12.5px;
  font-weight: 700;
}

.cs-filters button:hover {
  border-color: var(--cs-brand);
  color: var(--cs-ink);
}

.cs-filters button[aria-pressed='true'] {
  border-color: var(--cs-brand-strong);
  background: var(--cs-brand-strong);
  color: #fff;
}

.cs-filters button[aria-pressed='true'] span {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.cs-result {
  margin: 0 0 26px;
  color: var(--cs-body);
  font-size: 14px;
}

.cs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.cs-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cs-line);
  border-radius: 18px;
  background: #fff;
  color: var(--cs-body);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: cs-in 0.35s ease both;
}

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

a.cs-card:hover {
  border-color: transparent;
  color: var(--cs-body);
  box-shadow: 0 22px 44px rgba(40, 30, 80, 0.14);
  transform: translateY(-5px);
}

.cs-card__img {
  display: block;
  overflow: hidden;
  background: var(--cs-tint);
}

.cs-card__img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top;
  transition: transform 0.5s ease;
}

a.cs-card:hover .cs-card__img img {
  transform: scale(1.04);
}

.cs-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 22px 22px;
}

.cs-card__ind {
  margin-bottom: 6px;
  color: var(--cs-brand-strong);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cs-card__name {
  color: var(--cs-ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.cs-card__note {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
}

.cs-card__cta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  color: var(--cs-ink);
  font-size: 14.5px;
  font-weight: 600;
}

.cs-card__cta i {
  color: var(--cs-brand);
  transition: transform 0.2s ease;
}

a.cs-card:hover .cs-card__cta i {
  transform: translateX(4px);
}

.cs-card--study {
  border-color: #d8cdf0;
}

.cs-card--none .cs-card__cta {
  color: var(--cs-body);
  font-weight: 500;
}

.cs-empty {
  padding: 40px;
  border: 1px dashed var(--cs-line);
  border-radius: 16px;
  color: var(--cs-body);
  text-align: center;
}

/* Call to action */
.cs-cta {
  padding: 0 0 96px;
  background: #fff;
}

.cs-cta__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  align-items: center;
  justify-content: space-between;
  padding: 48px 52px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(135deg, #5a33c2, #805dcd);
}

.cs-cta__inner > div {
  flex: 1 1 420px;
}

.cs-cta h2 {
  margin-bottom: 10px;
  color: #fff;
  font-size: clamp(24px, 2.8vw, 34px);
}

.cs-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 17px;
  line-height: 1.6;
}

.cs-btn {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 14px 26px;
  border-radius: 8px;
  background: #fff;
  color: var(--cs-brand-strong);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.cs-btn:hover {
  background: var(--cs-soft);
  color: var(--cs-brand-strong);
}

.cs-hero a:focus-visible,
.cs-featured a:focus-visible,
.cs-all a:focus-visible,
.cs-all button:focus-visible,
.cs-cta a:focus-visible {
  outline: 3px solid var(--cs-brand);
  outline-offset: 3px;
}

@keyframes cs-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Responsive */
@media (max-width: 1199px) {
  .cs-grid {
    gap: 20px;
  }
}

@media (max-width: 991px) {
  .cs-hero {
    padding-top: 120px;
  }

  .cs-featured__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .cs-feat--lead {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .cs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .cs-featured__grid,
  .cs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-feat--lead .cs-feat__body {
    padding: 24px;
  }

  .cs-feat--lead .cs-feat__stat {
    font-size: 36px;
  }

  .cs-search {
    width: 100%;
  }

  .cs-filters {
    flex-wrap: nowrap;
    margin-right: -16px;
    padding-right: 16px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .cs-filters::-webkit-scrollbar {
    display: none;
  }

  .cs-filters button {
    flex: 0 0 auto;
  }

  .cs-cta__inner {
    padding: 32px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-card,
  .cs-feat,
  .cs-card__img img,
  .cs-feat img,
  .cs-card__cta i {
    animation: none;
    transition: none;
  }

  a.cs-card:hover,
  .cs-feat:hover,
  a.cs-card:hover .cs-card__img img,
  .cs-feat:hover img {
    transform: none;
  }
}
