/* ==========================================================================
   Template: Case — Figma "Mind the Body" 207:331 (and the other case frames)
   All sizes: calc(N * var(--k)), N = Figma px at 1440 wide.
   ========================================================================== */

.cs { position: relative; overflow: clip; }   /* clip, not hidden: hidden would break the sticky name */

/* ── Hero: mood image 1440 × 575 (Figma render incl. its black gradients) ── */
.cs-hero {
  position: relative; height: calc(575 * var(--k));
  background: #111 center / cover no-repeat;
}

/* ── Mockup: 915 × 515 card, radius 20, 120 from the top, overlapping the
      hero; the case showreel plays in it ── */
.cs-mockup {
  position: relative; z-index: 1;
  width: calc(915 * var(--k)); max-width: calc(100% - 32px);
  aspect-ratio: 915 / 515;
  margin: calc(-455 * var(--k)) auto 0;     /* top at 120: 575 − 455 */
  border-radius: calc(20 * var(--k)); overflow: hidden;
  background: #151515;
}
.cs-mockup video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Tags — outline buttons: 1px #353434, radius 5, 36 high, 20 apart ── */
.cs-tags {
  display: flex; flex-wrap: wrap; gap: calc(20 * var(--k));
  margin: calc(20 * var(--k)) 0 0 calc(495 * var(--k));
}
.cs-tag {
  display: inline-flex; align-items: center; height: calc(36 * var(--k));
  padding: 0 calc(21 * var(--k));
  border: 1px solid #353434; border-radius: calc(5 * var(--k));
  font-size: calc(15 * var(--k)); line-height: 1.1; color: var(--fg);
}

/* ── Body: name (sticky) left at 146, text column at 495, 450 wide ── */
.cs-body {
  position: relative;
  display: grid; grid-template-columns: calc(349 * var(--k)) calc(450 * var(--k));
  margin: calc(94 * var(--k)) 0 0 calc(146 * var(--k));   /* text at 785 */
}
/* Name: scrolls along 210 below the top of the screen (Figma: the name sits
   210 into a group that starts at the hero's bottom edge) until its bottom
   reaches the middle of the quote. case.js sizes the track to end there. */
.cs-name-track { position: relative; align-self: start; }
.cs-name {
  position: sticky; top: calc(210 * var(--k));
  font-size: calc(24 * var(--k)); line-height: 1.1; font-weight: 400;   /* Apercu Pro Regular */
  text-transform: uppercase; color: var(--muted);
}
.cs-copy { display: flex; flex-direction: column; gap: calc(90 * var(--k)); }
.cs-text p { font-size: calc(15 * var(--k)); line-height: 1.4; }
.cs-text p + p { margin-top: calc(21 * var(--k)); }          /* Figma: an empty line */

/* Quote card — #1e1e1e, radius 15, padding 30; Playfair 36 */
.cs-quote {
  margin: 0; padding: calc(30 * var(--k));
  background: #1e1e1e; border-radius: calc(15 * var(--k));
  display: flex; flex-direction: column; gap: calc(20 * var(--k));
}
.cs-quote blockquote { margin: 0; font-family: var(--serif); font-size: calc(36 * var(--k)); line-height: 1.1; }
.cs-quote figcaption { display: flex; align-items: center; gap: calc(12 * var(--k)); font-size: calc(15 * var(--k)); line-height: 1.4; }
.cs-quote img { width: calc(60 * var(--k)); height: calc(60 * var(--k)); border-radius: 50%; object-fit: cover; }
.cs-quote .role { display: block; font-weight: 500; text-transform: uppercase; color: var(--muted); }


/* ── Closer: "Let's get it done" + Contact us, then the client logos ── */
/* Exactly one screen: scrolled to the bottom you see only the menu, the CTA
   (centred vertically between menu and logos) and the logo band with its
   rule — the case strip sits just above, out of view. */
.cs-end {
  position: relative; width: 100%;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding-top: var(--header-h, calc(74 * var(--k)));   /* centre below the menu bar */
  padding-bottom: calc(60 * var(--k));
}
.cs-end .cta {
  margin-block: auto;   /* vertical centre of the space between menu and logos */
  display: flex; flex-direction: column; align-items: center; gap: calc(45 * var(--k));
  text-align: center; text-decoration: none;
}
.cs-end .cta p { font-family: var(--serif); font-size: calc(42 * var(--k)); line-height: 1.1; }
.cs-end .clients { width: 100%; }
.cs-end > * { position: relative; z-index: 1; }
/* The case's own header photo, flipped, cover, in a box just below the page with blur(100px): only the
   upward bleed showed. iOS Safari didn't draw that, so the visible 300px band is pre-rendered per case
   (tools/bake_glow.py → img/case/glow-<slug>[-phone].jpg). */
.cs-end::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: 0; right: 0; bottom: 0; height: 300px;
  background: var(--glow) 0 0 / 100% 100% no-repeat;
}
/* Keep the strip out of view when the phone's address bar collapses (same as the expertise pages). */
.cs-more + .cs-end { margin-top: calc(100lvh - 100svh); }

/* Phones */
@media (max-width: 900px) {
  .cs-hero { height: auto; aspect-ratio: 3 / 2; }   /* a third lower than a square */
  /* the photo runs behind the top two thirds of the video (video height = its width × 515/915) */
  .cs-mockup { margin-top: calc((100vw - 32px) * 515 / 915 * -2 / 3); border-radius: 12px; }
  .cs-tags { margin: 16px 16px 0; gap: 10px; }
  .cs-tag { height: 32px; padding: 0 14px; font-size: 14px; }
  .cs-body { display: block; margin: 56px 16px 0; }
  .cs-name-track { height: auto !important; }
  .cs-name { position: static; font-size: 16px; margin-bottom: 16px; }
  .cs-text p { font-size: 15px; }
  .cs-copy { gap: 40px; }
  .cs-quote { padding: 20px; border-radius: 12px; }
  .cs-quote blockquote { font-size: 26px; }
  .cs-quote figcaption { font-size: 14px; }
  .cs-quote img { width: 48px; height: 48px; }
  .cs-end { --header-h: 64px; padding-bottom: 40px; }
  .cs-end::before { background-image: var(--glow-phone); }
  .cs-end .cta p { font-size: 28px; }
}
