/* ============================================================================
   Case studies (cs-*): /case-studies/<slug>.
   Loaded after x3.css and x3-bm.css (the screenshot frames and the lightbox).
   Tokens only, from :root in x3.css. Square corners except pills.
   ========================================================================== */

/* ── The project ───────────────────────────────────────────────────────────── */

.cs-project .x3-lede + .x3-h3 { margin: 1.75rem 0 0.625rem; }


/* ── Screenshots of the pages we built ─────────────────────────────────────── */

.cs-gallery {
  display: grid;
  gap: clamp(1.75rem, 1.2rem + 1.6vw, 2.75rem) clamp(1.25rem, 0.8rem + 1.4vw, 2.25rem);
}
@media (min-width: 900px) { .cs-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cs-gallery figcaption strong { display: block; margin-bottom: 0.2rem; color: var(--ink); font-weight: 550; }

/* The homepage on a phone, beside what it shows. */
.cs-gallery .bm-frame__screen { --bm-ratio: 0.9375; }

.cs-phone {
  display: grid;
  gap: clamp(2rem, 1.4rem + 2vw, 3.5rem);
  align-items: center;
  margin-top: clamp(3rem, 2.2rem + 2.5vw, 4.5rem);
}
@media (min-width: 900px) { .cs-phone { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); } }
.cs-phone .bm-shot { width: min(100%, 17rem); margin-inline: auto; }
.cs-phone .bm-frame__screen { --bm-ratio: 2.164; }

.cs-live { margin-top: clamp(2rem, 1.6rem + 1.2vw, 3rem); }


/* ── Design: colours and type ──────────────────────────────────────────────── */

.cs-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-swatch {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.cs-swatch__chip {
  display: block;
  height: 4.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--swatch);
}
.cs-swatch__hex {
  padding: 0.625rem 0.75rem 0;
  font-size: 0.875rem;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.cs-swatch__use {
  padding: 0.15rem 0.75rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

.cs-fonts { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.cs-fonts li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
}
.cs-fonts strong { font-size: 1.125rem; font-weight: 550; }
.cs-fonts span { font-size: 0.875rem; color: var(--ink-muted); }

.cs-design { display: grid; gap: clamp(2rem, 1.4rem + 2vw, 3.25rem); }
@media (min-width: 1000px) { .cs-design { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.cs-design .x3-h3 { margin-bottom: 1rem; }
.cs-design .x3-lede + .x3-h3,
.cs-design .cs-palette + .x3-h3 { margin-top: 2rem; }


/* ── Build: the technical sheet and the four check lists ───────────────────── */

.cs-build { display: grid; gap: clamp(2rem, 1.4rem + 2vw, 3.25rem); }
.cs-sheet-title { margin: 2rem 0 0.75rem; }
@media (min-width: 1000px) { .cs-build { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }

.cs-checks { display: grid; gap: clamp(1rem, 0.8rem + 0.8vw, 1.5rem); }
@media (min-width: 760px) { .cs-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cs-checks .x3-tile__icon { margin-bottom: 0; }
/* Lists inside these tiles stay left-aligned on phones too: they are lists. */
.cs-checks .x3-tile { align-items: stretch; }
.cs-checks .x3-pkg__list { text-align: left; }


/* ── Related services ──────────────────────────────────────────────────────── */

.cs-services { display: grid; gap: clamp(1rem, 0.8rem + 0.8vw, 1.5rem); }
@media (min-width: 700px) { .cs-services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .cs-services { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
