/* ==========================================================================
   Individual case study pages — /case-study/<slug>/ — and the /client-success/
   index that lists them.

   Structure follows the order a sceptical reader actually needs: the claim,
   the proof (video or hero), the numbers, then the how. Every part of that is
   optional, because the set is not uniform — see the layout for what gates on
   what. Namespaced cs__* for a study, cx-* for the index.
   ========================================================================== */

.cs {
  padding-block: clamp(2rem, 5vw, 3.5rem) 0;
}

.cs__head {
  max-width: 62ch;
  text-align: center;
}

.cs__head .arcrel-lv-eyebrow {
  justify-content: center;
}

.cs__h1 {
  margin: 0 0 var(--sp-3);
  line-height: 1.06;
  color: var(--white);
  text-wrap: balance;
}

.cs__summary {
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}

/* The before/after figure, stated once and large. This is the whole argument
   of the page in one line. */
.cs__jump {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  margin: var(--sp-4) 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.cs__jump-from {
  font-size: var(--step-2);
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(161, 161, 181, 0.45);
}

.cs__jump-arrow {
  font-size: var(--step-1);
  color: var(--purple-light);
}

.cs__jump-to {
  font-size: var(--step-4);
  color: var(--white);
}

/* --- Video ---------------------------------------------------------------- */

.cs__video {
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.cs__player {
  max-width: 940px;
  margin-inline: auto;
}

.cs__play {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--divider);
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
  position: relative;
  display: block;
  padding: 0;
  transition: border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.cs__play:hover,
.cs__play:focus-visible {
  border-color: var(--purple-light);
  transform: translateY(-3px);
}

.cs__play img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.cs__runtime {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.25em 0.6em;
  border-radius: var(--radius);
  background: rgba(7, 4, 13, 0.82);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--white);
}

/* live.js replaces the button with this once played. aspect-ratio holds the
   space so nothing shifts on swap. */
.cs__player .arcrel-lv-vid__iframe {
  border-radius: var(--radius-lg);
}

/* Shown in place of the video facade when a case study has no video, so those
   pages still open on an image rather than straight into text.
   Same 940px measure as .cs__player, so a study with a hero and a study with a
   video present at the same size instead of the image running wider. No bottom
   spacing: .cs__body opens with its own, and doubling them leaves a visible
   hole on the pages that also have no results strip. */
.cs__hero {
  /* Block axis only. This element is also an .arcrel-lv-shell, and a blanket
     `margin: 0` cancels the shell's own `margin-inline: auto`, which drops the
     whole thing flush against the left edge. */
  margin-block: 0;
}

.cs__hero img {
  display: block;
  width: 100%;
  max-width: 940px;
  height: auto;
  margin-inline: auto;
  /* No border or panel. These are device mockups on a transparent background —
     a frame around them boxes in artwork that is already floating, and reads as
     a stray rectangle rather than a container. */
  border-radius: var(--radius-lg);
}

/* --- Results + body ------------------------------------------------------- */

.cs__body {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.cs__results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin: 0 0 clamp(2.5rem, 6vw, 4rem);
  padding: 0;
  list-style: none;
}

.cs__results li {
  padding: clamp(1.25rem, 3vw, 2rem);
  text-align: center;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
}

.cs__result-v {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-5);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--purple-light);
}

.cs__result-l {
  display: block;
  margin-top: 0.5em;
  font-family: var(--font-body);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--muted);
}

/* --- Prose ----------------------------------------------------------------
   The body is Markdown, so these are element-scoped rather than class-based:
   whoever writes a case study should never have to remember a class name. The
   scale matches the blog's arcrel-pr__* so the two read as one publication.
-------------------------------------------------------------------------- */

.cs__prose {
  /* A reading measure, centred in the shell. Rows that need the full width
     (the results strip above) sit outside this wrapper. */
  max-width: 68ch;
  margin-inline: auto;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.72;
  color: var(--muted);
  text-wrap: pretty;
}

.cs__prose > :first-child {
  margin-top: 0;
}

.cs__prose > :last-child {
  margin-bottom: 0;
}

.cs__prose p {
  margin: 0 0 var(--sp-3);
}

.cs__prose h2 {
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 var(--sp-2);
  line-height: 1.18;
  color: var(--white);
  text-wrap: balance;
}

.cs__prose h3 {
  margin: var(--sp-5) 0 var(--sp-2);
  line-height: 1.25;
  color: var(--white);
}

.cs__prose h4 {
  margin: var(--sp-4) 0 var(--sp-1);
  color: var(--warm-white);
}

/* base.css resets list-style globally, so prose has to opt back in — a
   Markdown list with no markers reads as a run of orphaned lines. */
.cs__prose ul,
.cs__prose ol {
  margin: 0 0 var(--sp-3);
  padding-left: 1.3em;
}

.cs__prose ul {
  list-style: disc;
}

.cs__prose ol {
  list-style: decimal;
}

.cs__prose li {
  margin-bottom: 0.6em;
}

.cs__prose li::marker {
  color: var(--purple-light);
}

/* The figures live inside bold on almost every imported page, so this is what
   makes the numbers findable when someone skims. */
.cs__prose strong {
  font-weight: 700;
  color: var(--warm-white);
}

.cs__prose em {
  color: var(--warm-white);
}

/* Likewise for underlines: inside running text, colour alone is not enough to
   mark a link. */
.cs__prose a {
  color: var(--purple-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.cs__prose a:hover,
.cs__prose a:focus-visible {
  color: var(--white);
}

/* --- Next + CTA ----------------------------------------------------------- */

.cs__next {
  padding-bottom: clamp(2.5rem, 6vw, 4rem);
}

.cs__next-label {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs__next-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs__next-list a {
  display: grid;
  gap: 0.3rem;
  padding: var(--sp-3);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.cs__next-list a:hover,
.cs__next-list a:focus-visible {
  border-color: var(--purple-light);
  transform: translateY(-3px);
}

.cs__next-vertical {
  font-family: var(--font-display);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-light);
}

.cs__next-title {
  line-height: 1.35;
  color: var(--white);
  text-wrap: balance;
}

.cs__cta {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.cs__cta-p {
  margin: 0 auto var(--sp-3);
  max-width: 48ch;
  line-height: 1.65;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .cs__play,
  .cs__next-list a {
    transition: none;
  }
  .cs__play:hover,
  .cs__next-list a:hover {
    transform: none;
  }
}

/* ==========================================================================
   /client-success/ — the proof index. Shares the cs-* CTA styles above.
   ========================================================================== */

.cx-hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}

/* Same breathing purple glow as the how-it-works hero, so the proof page
   opens on the same surface. Translucent and pointer-inert. */
.cx-hero::before {
  content: "";
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 780px;
  height: 520px;
  background: radial-gradient(
    ellipse at center,
    rgba(97, 25, 172, 0.35),
    rgba(124, 58, 237, 0.1) 45%,
    transparent 70%
  );
  filter: blur(40px);
  pointer-events: none;
  animation: arcrelCxBreath 7s ease-in-out infinite alternate;
}

@keyframes arcrelCxBreath {
  from {
    opacity: 0.7;
    transform: translateX(-50%) scale(1);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1.08);
  }
}

/* Constellation canvas (drawn by /assets/js/hero-net.js), fading toward the
   case rows below. */
.cx-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.cx-hero__bg canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

.cx-hero .arcrel-lv-eyebrow {
  justify-content: center;
}

.cx-hero__h1 {
  margin: 0 auto var(--sp-3);
  max-width: 18ch;
  line-height: 1.04;
  color: var(--white);
  text-wrap: balance;
}

.cx-hero__sub {
  margin: 0 auto;
  max-width: 54ch;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

/* The card design the how-it-works and homepage stat bars use: one bordered
   card per number with a purple hairline across its top edge. The fill is a
   faint white lift rather than a solid, so the hero's network canvas still
   reads behind the row. */
.cx-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: clamp(2rem, 5vw, 3rem) 0 0;
  padding: 0;
  list-style: none;
}

.cx-hero__stats li {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 40px 24px 34px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--divider);
  border-radius: 16px;
}

.cx-hero__stats li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
}

.cx-hero__v {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 54px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.cx-hero__l {
  display: block;
  margin-top: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 900px) {
  .cx-hero__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 560px) {
  .cx-hero__stats {
    grid-template-columns: 1fr;
  }

  .cx-hero__stats li {
    padding: 32px 20px 28px;
  }
}

/* --- Case rows ------------------------------------------------------------ */

.cx-list {
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.cx-case {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--divider);
}

/* Alternating sides so three rows do not read as a table. Source order is
   unchanged, so the media still comes first for a screen reader. */
.cx-case--flip .cx-case__media {
  order: 2;
}

.cx-case__media {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--divider);
  overflow: hidden;
  background: var(--card);
  transition: border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.cx-case__media:hover,
.cx-case__media:focus-visible {
  border-color: var(--purple-light);
  transform: translateY(-3px);
}

.cx-case__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.cx-case__runtime,
.cx-case__flag {
  position: absolute;
  padding: 0.25em 0.6em;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
}

.cx-case__runtime {
  right: 0.7rem;
  bottom: 0.7rem;
  background: rgba(7, 4, 13, 0.82);
  color: var(--white);
}

.cx-case__flag {
  left: 0.7rem;
  top: 0.7rem;
  background: var(--purple);
  color: var(--white);
}

.cx-case__vertical {
  margin: 0 0 var(--sp-1);
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-light);
}

.cx-case__jump {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.cx-case__from {
  font-size: var(--step-1);
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(161, 161, 181, 0.45);
}

.cx-case__arrow {
  color: var(--purple-light);
}

.cx-case__to {
  font-size: var(--step-3);
  color: var(--white);
}

.cx-case__title {
  margin: 0 0 var(--sp-2);
  line-height: 1.2;
  color: var(--white);
  text-wrap: balance;
}

.cx-case__summary {
  margin: 0 0 var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

.cx-case__results {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0 0 var(--sp-3);
  padding: 0;
  list-style: none;
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--muted);
}

.cx-case__results b {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--white);
}

.cx-case__cta {
  margin: 0;
}

@media (max-width: 820px) {
  .cx-case {
    grid-template-columns: 1fr;
  }
  /* Media back above the text on a single column, whichever side it was on. */
  .cx-case--flip .cx-case__media {
    order: 0;
  }
}

/* --- The rest of the work: grid -------------------------------------------
   The nine studies that do not carry a headline figure. A card rather than a
   full row, because the alternating row layout needs a number and a results
   list to fill it — nine of those in sequence is nine screens of empty space
   where the proof should be.
-------------------------------------------------------------------------- */

.cx-more {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--divider);
}

.cx-more__h2 {
  margin: 0 0 var(--sp-2);
  color: var(--white);
}

.cx-more__sub {
  margin: 0 0 clamp(2rem, 4vw, 3rem);
  max-width: 56ch;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}

.cx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cx-card {
  display: flex;
}

/* The whole card is the link, so there is no small target to hunt for and no
   nested interactive element to trap a keyboard user. */
.cx-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.cx-card__link:hover,
.cx-card__link:focus-visible {
  border-color: var(--purple-light);
  transform: translateY(-3px);
}

.cx-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--black);
}

.cx-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cx-card__play {
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
}

.cx-card__runtime {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: 600;
  color: var(--white);
}

.cx-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Pushes the jump figure to the bottom so it lines up across a row of cards
     whose titles wrap to different depths. */
  flex: 1;
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
}

.cx-card__vertical {
  font-family: var(--font-display);
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--purple-light);
}

.cx-card__title {
  line-height: 1.25;
  color: var(--white);
  text-wrap: balance;
}

.cx-card__summary {
  font-family: var(--font-body);
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--muted);
  text-wrap: pretty;
}

.cx-card__jump {
  margin-top: auto;
  padding-top: 0.75rem;
  font-family: var(--font-display);
  font-size: var(--step--1);
  color: var(--muted);
}

.cx-card__jump b {
  font-weight: 800;
  color: var(--white);
}

/* --- The honest bit -------------------------------------------------------- */

.cx-honest {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--divider);
}

.cx-honest__h2 {
  margin: 0 0 var(--sp-3);
  color: var(--white);
  text-wrap: balance;
}

.cx-honest__p {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.72;
  color: var(--muted);
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .cx-case__media,
  .cx-card__link {
    transition: none;
  }
  .cx-case__media:hover,
  .cx-card__link:hover {
    transform: none;
  }
}
