/* ==========================================================================
   Case study pages — inherits tokens from styles.css
   ========================================================================== */

.page--case-study {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 152px var(--pad-x) 0;
  display: flex;
  flex-direction: column;
  gap: 72px;

  --fs-row-heading: 26px;
  --fs-row-body: 15px;
  --fs-caption: 12px;
  --fs-caption-small: 12px;
  --gap-row: 44px;
  --gap-columns: 44px;
  --measure: 660px;
}

.page--case-study section,
.page--case-study .cs-hero,
.page--case-study .cs-divider,
.page--case-study .cs-head {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.cs-head {
  max-width: 820px;
}

.cs-head__eyebrow {
  margin: 0 0 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.cs-head__eyebrow span + span::before {
  content: '·';
  margin-right: 10px;
}

.cs-head__title {
  margin: 0;
  font-size: 56px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}

.cs-head__deck {
  margin: 24px 0 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: var(--measure);
}

/* --------------------------------------------------------------------------
   Hero panel — the shot inset on a tinted ground, as on the work cards
   -------------------------------------------------------------------------- */

.cs-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 44px 44px 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  aspect-ratio: 992 / 540;
  background: var(--band);
}

.cs-hero img {
  width: 100%;
  max-width: var(--native-w, 800px);
  height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  display: block;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.45);
}

/* For sources too small to fill the panel: sit the image at its native size
   on the tint rather than cropping and upscaling it. */
.cs-hero--fit {
  aspect-ratio: auto;
  align-items: center;
  padding: 56px 44px;
}

.cs-hero--fit img {
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, 0.4);
}

.cs-hero--rejigg { background: #e9e3d8; }
.cs-hero--primevideo { background: #e2e8f1; }
.cs-hero--alaska { background: #dbe8f3; }
.cs-hero--mint { background: #e0efe5; }
.cs-hero--expenseit { background: #dde7ef; }

/* --------------------------------------------------------------------------
   Meta strip
   -------------------------------------------------------------------------- */

.cs-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cs-info__item {
  min-width: 0;
  padding: 24px 26px;
}

.cs-info__item + .cs-info__item {
  border-left: 1px solid var(--rule);
}

.cs-info__label {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cs-info__value {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Shared blocks (Summary / Outcome / Reflection)
   -------------------------------------------------------------------------- */

.cs-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-block--muted {
  background: var(--band);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 48px;
}

.cs-outcome__label,
.cs-summary__subtitle {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cs-outcome__heading {
  margin: 0;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

.cs-outcome__body {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: var(--measure);
}

.cs-outcome__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.cs-outcome__list li {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.3;
  padding-left: 22px;
  position: relative;
}

.cs-outcome__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
}

.cs-summary__title {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.cs-summary__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: var(--measure);
}

.cs-reflection__heading {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.cs-reflection__body p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
  max-width: var(--measure);
}

.cs-reflection__body p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Text blocks
   -------------------------------------------------------------------------- */

.cs-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-columns);
}

.cs-columns__col {
  min-width: 0;
}

.cs-columns__heading,
.cs-intro__heading,
.cs-row__heading {
  margin: 0 0 16px;
  font-size: var(--fs-row-heading);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.cs-columns__col p,
.cs-intro p,
.cs-row__text p {
  margin: 0 0 16px;
  font-size: var(--fs-row-body);
  line-height: 1.75;
  color: var(--ink-2);
}

.cs-columns__col p:last-child,
.cs-intro p:last-child,
.cs-row__text p:last-child {
  margin-bottom: 0;
}

.cs-intro,
.cs-intro--full {
  max-width: var(--measure);
}

.cs-phase-heading {
  margin: 0;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Text + media rows
   -------------------------------------------------------------------------- */

.cs-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap-row);
  align-items: center;
}

.cs-row__text {
  min-width: 0;
}

.cs-row__text ul {
  margin: 0 0 16px;
  padding-left: 1.2em;
}

.cs-row__text li {
  font-size: var(--fs-row-body);
  line-height: 1.75;
  color: var(--ink-2);
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   Media — flat, hairline-bordered, rounded
   -------------------------------------------------------------------------- */

.cs-screenshot,
.cs-figure {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-screenshot img,
.cs-figure img,
.cs-plain-image,
.cs-compat-grid__col > img,
.cs-label-row__col img,
.cs-label-row__strip,
.cs-device-row img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: #fff;
}

.cs-screenshot img,
.cs-figure img {
  aspect-ratio: 3006 / 2288;
  object-fit: cover;
}

.cs-screenshot figcaption,
.cs-figure figcaption {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--ink-3);
  text-align: center;
}

.cs-screenshot--small img {
  aspect-ratio: 332 / 230;
}

.cs-screenshot--tall {
  height: 100%;
}

.cs-screenshot--tall img {
  aspect-ratio: 1139 / 4096;
}

.cs-screenshot--search-results img {
  aspect-ratio: 3024 / 1964;
}

.cs-screenshot--crop {
  position: relative;
  overflow: hidden;
  aspect-ratio: 584 / 945;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
}

.cs-screenshot--crop img {
  position: absolute;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  width: 108.88%;
  height: 109.89%;
  left: -5.28%;
  top: -4.89%;
  max-width: none;
}

.cs-plain-image {
  object-fit: cover;
}

.cs-figure--contain img {
  height: 260px;
  aspect-ratio: auto;
  object-fit: contain;
  padding: 16px;
  background: var(--band);
}

/* Self-hosted video */

.cs-video__player {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: #fff;
  max-width: 860px;
  margin: 0 auto;
}

/* Slide deck: a real clickthrough of a presentation */

.cs-deck {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}

.cs-deck:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 8px;
  border-radius: var(--radius-md);
}

.cs-deck__stage {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--band);
  aspect-ratio: 1100 / 619;
}

.cs-deck__slide {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cs-deck__slide[data-active] {
  display: block;
}

.cs-deck__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.cs-deck__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms var(--ease), transform 150ms var(--ease);
}

.cs-deck__nav:hover {
  background: var(--band);
  transform: translateY(-1px);
}

.cs-deck__nav svg {
  width: 12px;
  height: 16px;
}

.cs-deck__counter {
  margin: 0;
  min-width: 62px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.cs-deck figcaption {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--ink-3);
  text-align: center;
}

/* Presentation slides keep their 16:9 shape */

.cs-figure--slide img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  max-width: var(--native-w, 760px);
  margin: 0 auto;
}

/* Compatibility grid */

.cs-compat-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.cs-compat-grid__col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cs-compat-grid__col > img:nth-of-type(1) { aspect-ratio: 1430 / 970; object-fit: cover; }
.cs-compat-grid__col > img:nth-of-type(2) { aspect-ratio: 1430 / 658; object-fit: cover; }
.cs-compat-grid__col > img:nth-of-type(3) { aspect-ratio: 1430 / 830; object-fit: cover; }

/* Documentation pages: every image is a document, an artefact or a photo, so
   show it whole rather than cropping it to the shared screenshot ratio */

.page--uncropped .cs-screenshot img,
.page--uncropped .cs-figure img,
.page--uncropped .cs-plain-image {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}

.page--uncropped .cs-row {
  align-items: start;
}

/* Sources narrower than the column: cap at native width so they stay sharp.
   Set --native-w on the figure to the image's real pixel width. */
.cs-figure--native img,
.cs-plain-image--native {
  max-width: var(--native-w, 100%);
  margin-inline: auto;
}

.cs-figure--tall img {
  max-width: 520px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Callouts and citations
   -------------------------------------------------------------------------- */

.cs-citation {
  min-width: 0;
  background: var(--band);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cs-citation p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

.cs-citation p:last-child {
  margin-bottom: 0;
}

.cs-citation a {
  color: var(--ink);
}

.cs-callout {
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  width: 100%;
  background: var(--ink);
}

.cs-callout--light {
  background: var(--band);
  border: 1px solid var(--rule);
}

.cs-callout.cs-callout--light p {
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.cs-callout.cs-callout--light p + p {
  margin-top: 14px;
}

.cs-exchange__who {
  flex-shrink: 0;
  width: 96px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.cs-callout p {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.15;
  max-width: 800px;
}

/* --------------------------------------------------------------------------
   Labelled column rows
   -------------------------------------------------------------------------- */

.cs-label-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap-row);
  align-items: start;
  width: 100%;
}

.cs-label-row > .cs-screenshot {
  align-self: end;
}

.cs-label-row > .cs-screenshot figcaption {
  min-height: 2.4em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-label-row__col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-label-row__label {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
}

.cs-label-row__col ul {
  margin: 0;
  padding-left: 1.2em;
}

.cs-label-row__col li {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 6px;
}

.cs-label-row__col li:last-child {
  margin-bottom: 0;
}

.cs-label-row__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

.cs-label-row__pair p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.65;
}

.cs-device-row {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  width: 100%;
}

.cs-device-row img:first-child {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 800 / 897;
  object-fit: cover;
}

.cs-device-row img:last-child {
  flex: 0 0 300px;
  max-width: 300px;
  aspect-ratio: 320 / 593;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   Quote cards
   -------------------------------------------------------------------------- */

.cs-quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  width: 100%;
}

.cs-quote-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 124px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: var(--band);
  border: 1px solid var(--rule);
}

.cs-quote-bubble p {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
  line-height: 1.35;
}

.cs-quote-bubble__tail {
  display: none;
}

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */

.cs-divider {
  height: 1px;
  background: var(--rule);
  border: none;
}

/* --------------------------------------------------------------------------
   Explore more
   -------------------------------------------------------------------------- */

.cs-explore {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  padding: 72px 0 96px;
  border-top: 1px solid var(--rule);
}

.cs-explore__heading {
  margin: 0;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.cs-explore .work-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 20px;
}

.cs-explore .work-card__panel {
  aspect-ratio: 4 / 3;
  padding: 18px 18px 0;
}

.cs-explore .work-card__title {
  font-size: 16px;
}

.cs-explore .work-card__cta {
  display: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .page--case-study {
    gap: 56px;
    padding-top: 128px;
    --fs-row-heading: 22px;
    --gap-row: 32px;
    --gap-columns: 32px;
  }

  .cs-head__title {
    font-size: 40px;
  }

  .cs-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-info__item:nth-child(odd) {
    border-left: none;
  }

  .cs-info__item:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }

  .cs-hero {
    padding: 28px 28px 0;
  }

  .cs-block--muted {
    padding: 32px;
  }

  .cs-callout {
    padding: 36px 32px;
  }

  .cs-callout p {
    font-size: 24px;
  }

  .cs-explore .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page--case-study {
    gap: 44px;
    padding-top: 104px;
    --fs-row-heading: 21px;
    --gap-row: 24px;
    --gap-columns: 24px;
  }

  .cs-head__title {
    font-size: 32px;
  }

  .cs-head__deck {
    font-size: 15px;
  }

  .cs-hero {
    aspect-ratio: 4 / 3;
    padding: 18px 18px 0;
    border-radius: var(--radius-md);
  }

  .cs-info {
    grid-template-columns: 1fr;
  }

  .cs-info__item + .cs-info__item {
    border-left: none;
    border-top: 1px solid var(--rule);
  }

  .cs-columns,
  .cs-row,
  .cs-label-row,
  .cs-device-row,
  .cs-compat-grid,
  .cs-label-row__pair,
  .cs-quote-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cs-device-row img:last-child {
    max-width: 100%;
    flex: 1 1 auto;
  }

  .cs-outcome__heading,
  .cs-phase-heading {
    font-size: 28px;
  }

  .cs-outcome__list li {
    font-size: 18px;
  }

  .cs-summary__title,
  .cs-reflection__heading,
  .cs-explore__heading {
    font-size: 24px;
  }

  .cs-callout p {
    font-size: 20px;
  }

  .cs-callout.cs-callout--light p {
    flex-direction: column;
    gap: 4px;
  }

  .cs-exchange__who {
    width: auto;
  }

  .cs-block--muted {
    padding: 24px 20px;
    border-radius: var(--radius-md);
  }

  .cs-callout {
    padding: 28px 22px;
    border-radius: var(--radius-md);
  }

  .cs-explore {
    padding: 48px 0 64px;
  }

  .cs-explore .work-grid {
    grid-template-columns: 1fr;
  }
}
