/* Case studies (case-study-*.html). Long-form like the service pages
   (services.css), plus what a case study needs: a facts row, the work as
   the hero (its screens live on wide screens), the before and after
   (shared, in studio.css), measured numbers, a short line-by-line list
   and recordings of the site in motion. Loaded after studio.css and
   services.css; case-study.js plays the recordings. */

.case-page h1.cs-title {
  max-width: none;
  margin-top: 26px;
  font-size: clamp(64px, 13.5vw, 214px);
  line-height: 0.86;
  letter-spacing: -0.078em;
}
.case-page .cs-sub {
  max-width: 780px;
  margin-top: 34px;
  font-size: clamp(21px, 2.3vw, 32px);
  line-height: 1.24;
  letter-spacing: -0.035em;
  color: #e4e4df;
}

/* The facts: who, what, where, when */
.cs-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 24px;
  margin: 56px 0 0;
  border-top: 1px solid var(--line);
}
.cs-facts div {
  padding-top: 18px;
}
.cs-facts dt {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a95;
}
.cs-facts dd {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}
.cs-facts a {
  border-bottom: 1px solid #66665f;
}
.cs-facts a:hover {
  border-color: var(--text);
}
@media (max-width: 900px) {
  .cs-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 20px;
  }
}
@media (max-width: 560px) {
  .cs-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The hero: the new site, big, on the project's own colour. On wide
   screens a recording of each screen plays over the still, placed exactly
   where the still's screens are (hero-*.webp is 2000 x 1000: the laptop
   screen sits at 250,96 and is 1296 x 810 with 16px corners; the phone
   screen at 1451,247, 318 x 696, 40px corners). Each fades in once it's
   playing. */
.cs-hero {
  margin: 64px 0 0;
}
.cs-hero-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--hero-radius);
  background: #efede6;
}
.cs-hero picture,
.cs-hero img {
  display: block;
  width: 100%;
  height: auto;
}
.cs-hero video {
  position: absolute;
  display: block;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.cs-hero video.is-playing {
  opacity: 1;
}
.cs-hero-desk {
  left: 12.5%;
  top: 9.6%;
  width: 64.8%;
  height: 81%;
  border-radius: 1.23% / 1.98%;
}
.cs-hero-phone {
  left: 72.55%;
  top: 24.7%;
  width: 15.9%;
  height: 69.6%;
  border-radius: 12.58% / 5.75%;
}
.cs-hero figcaption {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #9a9a95;
  visibility: hidden;
}
.cs-hero.is-live figcaption {
  visibility: visible;
}
@media (max-width: 700px) {
  .cs-hero {
    margin-top: 44px;
  }
  .cs-hero video,
  .cs-hero figcaption {
    display: none;
  }
}

/* The numbers: measured, with where they came from */
.cs-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 96px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.cs-numbers h2 {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.cs-number .cs-from {
  font-size: 15px;
  color: #9a9a95;
}
.cs-number .cs-from s {
  text-decoration-color: rgba(154, 154, 149, 0.7);
}
.cs-number .cs-to {
  display: block;
  margin-top: 10px;
  font-size: clamp(56px, 7vw, 108px);
  line-height: 0.9;
  letter-spacing: -0.065em;
  color: var(--text);
}
.cs-number p {
  max-width: 330px;
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.55;
  color: #b9b9b4;
}
.cs-source {
  grid-column: 1 / -1;
  max-width: 900px;
  font-size: 12px;
  line-height: 1.55;
  color: #9a9a95;
}
@media (max-width: 760px) {
  /* Three across on a phone too: short lines, smaller figures */
  .cs-numbers {
    gap: 22px 14px;
    margin-top: 72px;
  }
  .cs-number .cs-from {
    font-size: 12px;
  }
  .cs-number .cs-to {
    margin-top: 6px;
    font-size: clamp(30px, 9vw, 44px);
  }
  .cs-number p {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.45;
  }
}

/* A section whose content runs the full width under its heading */
.case-page .block--wide {
  grid-template-columns: minmax(0, 1fr);
}
.case-page .block--wide > header {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 32px 56px;
  align-items: end;
}
.case-page .block--wide h2 {
  max-width: 700px;
}
.case-page .block--wide > header p {
  max-width: 620px;
  font-size: 17px;
  line-height: 1.62;
  color: #b9b9b4;
}
@media (max-width: 900px) {
  .case-page .block--wide > header {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

/* Before and after, row by row: the old site muted, the new one lit */
.cs-rows {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}
.cs-rows li {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) minmax(0, 1fr) minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.cs-rows li:first-child {
  border-top: 0;
}
.cs-rows li > * {
  padding: 22px 24px;
  font-size: 15px;
  line-height: 1.55;
}
.cs-rows .cs-what {
  padding-top: 25px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a95;
}
.cs-rows .cs-old {
  color: #9a9a95;
}
.cs-rows .cs-new {
  color: var(--text);
  background: rgba(244, 244, 241, 0.045);
}
.cs-rows .cs-old::before,
.cs-rows .cs-new::before {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cs-rows .cs-old::before {
  content: "Before";
  color: #8b8b84;
}
.cs-rows .cs-new::before {
  content: "After";
  color: #cfcfca;
}
@media (max-width: 760px) {
  .cs-rows li {
    grid-template-columns: minmax(0, 1fr);
  }
  .cs-rows li > * {
    padding: 16px 18px;
  }
  .cs-rows .cs-what {
    padding: 20px 18px 0;
  }
}

/* The build: recordings of the site in motion, then stills. Each clip
   plays only while it's on screen (case-study.js). */
.cs-clips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 44px 28px;
  margin-top: 8px;
}
.cs-clip {
  margin: 0;
}
.cs-clip--wide {
  grid-column: 1 / -1;
}
.cs-clip video,
.cs-clip img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 18px;
  background: #0c0c0b;
  box-shadow: 0 0 0 1px rgba(244, 244, 241, 0.1);
}
.cs-clip figcaption {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #9a9a95;
}
.cs-clip figcaption strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 500;
  color: var(--text);
}
@media (max-width: 700px) {
  .cs-clips {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .cs-clip video,
  .cs-clip img {
    border-radius: 12px;
  }
}

/* What's still to come, and the closing line */
.case-page .closing p {
  max-width: 520px;
  margin-top: 22px;
  font-size: 17px;
  line-height: 1.55;
  color: #b9b9b4;
}
.case-page .closing .text-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 13px;
  color: #cfcfca;
}
.case-page .closing .text-link:hover {
  color: var(--text);
}
