/*
 * Case study pages. These stand beside the captured Ploy markup rather than
 * inside it, so they get their own stylesheet — but they read the same brand
 * custom properties where those exist, with literals as the fallback, so the
 * two look like one site.
 */
:root {
  /* The brand tokens live in assets/theme.css, which every page links; these
     fall back to the same values only if that sheet fails to load, so there is
     one place to change a colour rather than two that can drift apart. */
  --cs-bg: var(--ploy-neutral-primary, #fff1e5);
  --cs-ink: var(--ploy-text-primary, oklch(20% 0 0));
  --cs-surface: rgba(255, 255, 255, 0.55);
  --cs-line: rgba(0, 0, 0, 0.14);
  --cs-measure: 46rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cs-bg);
  color: var(--cs-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.cs-wrap { max-width: 76rem; margin: 0 auto; padding: 3.5rem 1.25rem 4rem; }

.cs-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.cs-eyebrow a { text-decoration: none; }
.cs-eyebrow a:hover { text-decoration: underline; }

h1 { margin: 0 0 0.75rem; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.08; font-weight: 700; letter-spacing: -0.02em; }
.cs-lede { margin: 0 0 2rem; max-width: var(--cs-measure); font-size: 1.125rem; }

/* --- tags ----------------------------------------------------------------- */

.cs-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0 0 1rem; padding: 0; }
.cs-tags li {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--cs-line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- index grid ----------------------------------------------------------- */

.cs-grid {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
}
.cs-card a {
  display: flex; flex-direction: column; height: 100%;
  background: var(--cs-surface);
  border-radius: 1rem;
  overflow: hidden;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.cs-card a:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14); }
.cs-card a:focus-visible { outline: 2px solid var(--cs-ink); outline-offset: 3px; }
.cs-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.cs-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cs-card__text { display: block; padding: 1.25rem; }
.cs-card__name { display: block; font-weight: 700; font-size: 1.125rem; margin-bottom: 0.35rem; }
.cs-card__summary { display: block; font-size: 0.9rem; opacity: 0.8; margin-bottom: 0.9rem; }
.cs-card .cs-tags { margin: 0; }

/* --- article -------------------------------------------------------------- */

.cs-hero { margin: 2rem 0 2.5rem; }
.cs-hero img { width: 100%; border-radius: 1rem; }

.cs-body { max-width: var(--cs-measure); }
.cs-body p { margin: 0 0 1.25rem; }
.cs-body h2 { margin: 2.5rem 0 0.75rem; font-size: 1.5rem; line-height: 1.2; }
.cs-body ul { margin: 0 0 1.25rem; padding-left: 1.1rem; }
.cs-body li { margin-bottom: 0.4rem; }
.cs-body blockquote {
  margin: 2rem 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--cs-ink);
  font-size: 1.125rem;
  font-style: italic;
}
/* Figures break out of the reading measure — the screenshots carry the story. */
.cs-body figure {
  margin: 2rem 0;
  width: min(76rem - 2.5rem, calc(100vw - 2.5rem));
}
.cs-body figure img { border-radius: 0.75rem; width: 100%; }

.cs-next { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--cs-line); }
.cs-next a { text-decoration: none; font-weight: 700; font-size: 1.125rem; }
.cs-next a:hover { text-decoration: underline; }
.cs-next span { display: block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }

/* --- footer --------------------------------------------------------------- */

.cs-footer { border-top: 1px solid var(--cs-line); padding: 2rem 1.25rem; text-align: center; }
.cs-footer p { margin: 0; font-size: 0.875rem; opacity: 0.7; }

@media (max-width: 640px) {
  .cs-wrap { padding: 2.25rem 1rem 3rem; }
  .cs-grid { grid-template-columns: 1fr; }
}

/* Stat row — only rendered for case studies with confirmed figures. */
.cs-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  margin: 2rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--cs-rule, rgba(0, 0, 0, 0.15));
}
.cs-metrics div {
  display: flex;
  flex-direction: column-reverse;
}
.cs-metrics dd {
  margin: 0;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.cs-metrics dt {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

/* Engagement dates, where the source recorded them. */
.cs-period {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

/* Divider between the summary framing and the detailed narrative. */
.cs-split {
  margin: 3.5rem 0 0;
  border: 0;
  border-top: 1px solid var(--cs-rule, rgba(0, 0, 0, 0.15));
}
