/* ==========================================================================
   Case study pages
   Each page sets its accent on <body style="--accent: …">
   ========================================================================== */

.cs { --accent: var(--blue); }

.cs-container {
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.cs-hero {
  padding: calc(var(--header-h) + 70px) var(--gutter) 90px;
  text-align: center;
}
.cs-hero__eyebrow {
  font-size: 16px;
  margin-bottom: 18px;
}
.cs-hero__title {
  max-width: 15em;
  margin: 0 auto;
  font-size: clamp(40px, 6.3vw, 84px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: var(--track-display);
  color: var(--accent);
}

.cs-cover {
  position: relative;
  height: clamp(340px, 69vw, 885px);
  overflow: hidden;
}
.cs-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Two-column text sections
   -------------------------------------------------------------------------- */
.cs-section { padding-top: 120px; }

.cs-row {
  display: grid;
  grid-template-columns: 31% 1fr;
  gap: 0;
  align-items: start;
}
.cs-h2 {
  font-size: clamp(32px, 3.7vw, 48px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: var(--track-heading);
  color: var(--accent);
  padding-right: 24px;
}
.cs-body p {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 1em;
  max-width: 44em;
}
.cs-body p:last-child { margin-bottom: 0; }
.cs-body a {
  color: var(--accent);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease-out);
}
.cs-body a:hover { background-size: 0% 1px; background-position: 100% 100%; }

/* Numbered points (challenge / user flows) */
.cs-points { margin-top: 18px; counter-reset: pt; }
.cs-points li {
  position: relative;
  font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.45;
  padding: 10px 0 10px 0;
}
.cs-points li strong { font-weight: 700; }
.cs-points--rule li { border-top: 1px solid rgba(0, 0, 0, 0.08); }
.cs-points--rule li:last-child { border-bottom: 1px solid rgba(0, 0, 0, 0.08); }

/* --------------------------------------------------------------------------
   Meta: timeframe / role / tools
   -------------------------------------------------------------------------- */
.cs-meta {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-top: 36px;
}
.cs-meta::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  opacity: .35;
  transform-origin: 0 50%;
  transform: scaleX(var(--rule, 1));
}
.cs-meta dt {
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 10px;
}
.cs-meta dd {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 22em;
}

/* --------------------------------------------------------------------------
   Target users band
   -------------------------------------------------------------------------- */
.cs-band {
  position: relative;
  margin-top: 140px;
  height: 600px;
  background: var(--accent);
  color: var(--white);
  overflow: hidden;
  display: flex;
  align-items: center;
}
.cs-band__bg {
  position: absolute; inset: -10% 0;
  width: 100%; height: 120%;
  object-fit: cover;
}
.cs-band__inner {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.cs-band__title {
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: var(--track-heading);
  line-height: 1.2;
  margin-bottom: 12px;
}
.cs-band__text { font-size: 17px; opacity: .92; }

/* --------------------------------------------------------------------------
   Figures
   -------------------------------------------------------------------------- */
.cs-figure {
  margin-top: 50px;
  overflow: hidden;
  border-radius: var(--r-md);
}
.cs-figure img { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   Horizontal gallery
   -------------------------------------------------------------------------- */
.cs-gallery {
  margin-top: 120px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: var(--white);
}
/* Desktop: the gallery pins as a full-height, opaque panel so nothing above
   peeks through, and slides are sized to always fit below the header. */
@media (min-width: 861px) {
  .cs-gallery {
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--header-h) 0 var(--s-6);
    box-sizing: border-box;
  }
  .cs-gallery__slide { width: min(78vw, 1100px, calc((100svh - var(--header-h) - 120px) * 16 / 9)); }
}
.cs-gallery__track {
  display: flex;
  gap: 20px;
  padding: 0 var(--gutter);
  width: max-content;
  will-change: transform;
}
.cs-gallery__slide {
  flex: 0 0 auto;
  width: min(78vw, 1100px);
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #eef2f7;
}
.cs-gallery__slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.1);
}
.cs-gallery__progress {
  margin: 28px var(--gutter) 0;
  max-width: 220px;
  height: 2px;
  background: rgba(0, 0, 0, .08);
  border-radius: 2px;
  overflow: hidden;
}
.cs-gallery__progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* --------------------------------------------------------------------------
   Detailed case study / live link
   -------------------------------------------------------------------------- */
.cs-more {
  padding: 140px var(--gutter) 120px;
  text-align: center;
}
.cs-more__title {
  max-width: 11em;
  margin: 0 auto 36px;
  font-size: clamp(38px, 5.1vw, 66px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: var(--track-display);
  color: var(--blue);
}
.cs-more__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   "Have a Project for me?"
   -------------------------------------------------------------------------- */
.cs-cta {
  position: relative;
  height: 423px;
  overflow: hidden;
  background: #000;
  color: var(--white);
  display: flex;
  align-items: center;
}
.cs-cta__bg {
  position: absolute; inset: -15% 0;
  width: 100%; height: 130%;
  object-fit: cover;
  opacity: .9;
}
.cs-cta__inner {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.cs-cta__title {
  font-size: clamp(44px, 5.9vw, 76px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: var(--track-heading);
  margin-bottom: 30px;
}
.cs-cta .btn svg { margin-left: 10px; }
.cs-cta + .footer { margin-top: -40px; z-index: 2; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .cs-hero { padding-top: calc(var(--header-h) + 40px); padding-bottom: 56px; }
  .cs-section { padding-top: 80px; }
  .cs-row { grid-template-columns: 1fr; gap: 20px; }
  .cs-meta { grid-template-columns: 1fr; gap: 24px; }
  .cs-band { height: 420px; margin-top: 90px; }
  .cs-gallery { margin-top: 80px; }
  .cs-gallery__track {
    width: auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cs-gallery__track::-webkit-scrollbar { display: none; }
  .cs-gallery__slide { width: 86vw; scroll-snap-align: center; }
  .cs-gallery__slide img { transform: none; }
  .cs-gallery__progress { display: none; }
  .cs-more { padding: 90px var(--gutter) 80px; }
  .cs-cta { height: 380px; }
}
