/* ════════════════════════════
   CS PAGE WRAPPER
════════════════════════════ */
.cs-page {
  padding-top: 6.25rem;
}

.cs-container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-margin);
}

/* ════════════════════════════
   CS OVERVIEW (HERO TEXT)
════════════════════════════ */
.cs-overview {
  padding: var(--section-gap) var(--page-margin) 4rem;
}

.cs-overview__inner {
  max-width: var(--content-body);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.cs-overview__title-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 46.6875rem;
}

.cs-overview__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
}

.cs-overview__tagline {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--mid);
}

.cs-overview__description {
  font-family: var(--font-body);
  font-size: var(--text-body-lg);
  color: var(--dark);
  line-height: 1.5;
  max-width: var(--content-max);
}

.cs-overview__links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ════════════════════════════
   CS HERO IMAGE
════════════════════════════ */
.cs-hero-img {
  padding: 0 var(--page-margin);
  margin-bottom: 0;
}

.cs-hero-img__wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  height: 50.1875rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cs-hero-img__wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ════════════════════════════
   PROJECT DETAILS
════════════════════════════ */
.cs-details {
  padding: 3.5rem var(--page-margin) 4rem;
  border-bottom: 1px solid var(--border);
}

.cs-details__inner {
  max-width: var(--content-body);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.cs-details__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.cs-details__cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 10rem;
}

.cs-details__cell--wide {
  flex: 1;
}

.cs-details__label {
  font-family: var(--font-display);
  font-size: var(--text-body);
  color: var(--mid);
}

.cs-details__value {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--dark);
}

/* ════════════════════════════
   CS QUOTE (CEREAL / USER)
════════════════════════════ */
.cs-quote {
  padding: 0 var(--page-margin);
  margin: 5rem 0 0 0;
}

.cs-quote__wrap {
  max-width: var(--content-box);
  margin: 0 auto;
  height: 27.375rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 6rem;
}

.cs-quote__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  filter: blur(2px);
  transform: scale(1);
}

.cs-quote__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(1.5px);
}

.cs-quote__content {
  position: relative;
  z-index: 1;
  max-width: 46.75rem;
  text-align: left;
}

.cs-quote__text {
  font-family: var(--font-display);
  font-size: var(--text-stat);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 1.5rem;
  text-indent: -0.01em;
  hanging-punctuation: first;
}

.cs-quote--dark .cs-quote__text {
  color: var(--white);
}

.cs-quote__attribution {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--white);
}

.cs-quote--dark .cs-quote__attribution {
  color: rgba(255,255,255,0.85);
}

/* ════════════════════════════
   CS CONTENT SECTIONS
════════════════════════════ */
.cs-section {
  padding: 5rem var(--page-margin) 2.5rem;
}

.cs-section__inner {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cs-subhead {
  font-family: var(--font-display);
  font-size: var(--text-card);
  line-height: 1.2;
  color: var(--black);
}

.cs-desc {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--mid);
  line-height: 1.5;
  max-width: var(--content-max);
}

.cs-section-subhead {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--dark);
  line-height: 1.5;
  font-weight: 600;
  max-width: var(--content-max);
}

.ol {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--dark);
  line-height: 1.5;
  font-weight: 400;
  max-width: var(--content-max);
}

.ol li {
  margin-bottom: 1rem;
}

/* ════════════════════════════
   CS INSIGHT BOXES
════════════════════════════ */
.cs-insight-box {
  padding: 0 var(--page-margin);
  margin: 1rem 0;
}

.cs-insight-box__inner {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3.75rem 3.9375rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.cs-insight-box--white {
  background: var(--white);
}

/* Safari: video inside insight box — prevent hairline bleed + position jitter during playback */
.cs-insight-box__inner video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.cs-insight__inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cs-insight-box__2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.75rem;
  align-items: center;
}

.cs-insight-box__phone {
  max-width: 20rem;
  margin: 0 auto;
  padding: 0 0 3.75rem;
}

.cs-insight-box__phone img {
  width: 100%;
  height: auto;
}

.cs-insight-box__points {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cs-insight-point {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--mid);
  line-height: 1.5;
}

.cs-insight-point strong {
  font-weight: 600;
}

.cs-insight-point--bullet {
  display: flex;
  gap: 0.75rem;
}

.cs-insight-box__stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.cs-stat-badge {
  display: flex;
  flex-direction: column;
  align-items: left;
  justify-content: top;
  padding: 0.5rem 0;
  text-align: left;
  gap: 0.5rem;
}

.cs-stat-badge__emoji {
  font-size: 1.625rem;
}

.cs-stat-badge__text {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  color: var(--dark);
  line-height: 1.3;
}

/* ════════════════════════════
   CS ICONS ROW
════════════════════════════ */
.cs-icons-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.cs-icon-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2rem 0 0 0;
  text-align: left;
  gap: 0.5rem;
}

.cs-icon-badge__text {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  color: var(--mid);
  line-height: 1.4;
}

.cs-icon-badge__icon img {
  height: 1.625rem;
  width: auto; 
}

/* ════════════════════════════
   CS FULL-WIDTH AND INNER IMAGE
════════════════════════════ */
.cs-full-img {
  padding: 1rem var(--page-margin);
}

.cs-full-img__inner {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cs-full-img__inner img {
  width: 100%;
  height: auto;
  display: block;
}

/* ════════════════════════════
   CS PHOTO 2 BY 2 GRID
════════════════════════════ */
.cs-photo-grid {
  padding: 1rem var(--page-margin);
}

.cs-photo-grid__inner {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cs-photo-grid__item {
  aspect-ratio: 538/348;
  overflow: hidden;
}

.cs-photo-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ════════════════════════════
   CS VIDEO
════════════════════════════ */
.cs-video {
  padding: 1rem var(--page-margin);
}

.cs-video__inner {
  width: 100%;
  max-width: var(--content-body-cs);
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.cs-video__inner video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ════════════════════════════
   CS PHONE MOCKUP
════════════════════════════ */
.cs-phone-mockup {
  padding: 1rem var(--page-margin);
}

.cs-phone-mockup__stage {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  background: #ebebeb;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem;
}

.cs-phone-mockup__device {
  position: relative;
  width: 100%;
  max-width: 16rem;
}

.cs-phone-mockup__frame {
  width: 100%;
  height: auto;
  display: block;
}

.cs-phone-mockup__screen {
  position: absolute;
  /* top/bottom are % of containing block height; left/right are % of width */
  top: 1.367%;
  bottom: 1.617%;
  left: 3.666%;
  right: 4.005%;
  border-radius: 2.1875rem;
  overflow: hidden;
}

.cs-phone-mockup__screen video {
  width: 100%;
  height: 100%;
  display: block;
}

/* ════════════════════════════
   CS TV MOCKUP
════════════════════════════ */
.cs-tv-mockup {
  padding: 1rem var(--page-margin) 1.5rem;
}

.cs-tv-mockup__stage {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  background: #ebebeb;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 5rem;
}

.cs-tv-mockup__device {
  position: relative;
  width: 100%;
  max-width: 56rem;
}

.cs-tv-mockup__frame {
  width: 100%;
  height: auto;
  display: block;
}

.cs-tv-mockup__screen {
  position: absolute;
  /*
    Measured from cs-tv-body.png (1882 × 1200 px):
      screen starts at x:16,  y:16
      screen ends   at x:1865, y:1060  (stand + bezel below = 140 px)
    top    = 16 / 1200   = 1.333%   (% of containing block height)
    bottom = 140 / 1200  = 11.667%  (stand eats this slice)
    left   = 16 / 1882   = 0.850%   (% of containing block width)
    right  = 17 / 1882   = 0.903%
  */
  top: 1.333%;
  bottom: 11.667%;
  left: 0.850%;
  right: 0.903%;
  overflow: hidden;
}

.cs-tv-mockup__screen img,
.cs-tv-mockup__screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .cs-tv-mockup__stage {
    padding: 2rem 1.5rem;
  }
}

/* ════════════════════════════
   CS LAPTOP MOCKUP
════════════════════════════ */
.cs-laptop-mockup {
  padding: 1rem var(--page-margin) 2rem;
}

.cs-laptop-mockup__stage {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  background: #ebebeb;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 3rem;
}

.cs-laptop-mockup__device {
  position: relative;
  width: 100%;
  max-width: 44rem;
}

.cs-laptop-mockup__frame {
  width: 100%;
  height: auto;
  display: block;
}

.cs-laptop-mockup__screen {
  position: absolute;
  /*
    Measured from cs-laptop-body.png (1546 × 893 px):
      screen starts at x:179, y:186
      screen ends   at x:1366, y:696
    top    = 53.58 / 893   = 6%
    bottom = 687.61 / 893   = 7.7%
    left   = 179.336 / 1546  = 11.6%
    right  = 176.244 / 1546  = 11.4%
  */
  top: 6%;
  bottom: 7.7%;
  left: 11.6%;
  right: 11.4%;
  overflow: hidden;
}

.cs-laptop-mockup__screen img,
.cs-laptop-mockup__screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .cs-laptop-mockup__stage {
    padding: 2rem 1.5rem;
  }
}

/* ════════════════════════════
   CS SCROLLABLE CARDS
════════════════════════════ */
.cs-scroll-cards {
  padding: 1rem var(--page-margin);
}

/*
.cs-scroll-cards__label {
  max-width: var(--content-body-cs);
  margin: 0 auto 1rem;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--black);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 1rem;
}
*/

.cs-scroll-cards__label img {
  width: 2rem;
  height: auto;
}

.cs-scroll-cards__track {
  display: flex;
  gap: 1.25rem;
  /* Left edge aligns with --content-body-cs centred within the page.
     Target: max(P, (100vw − C) / 2)  — same rule as .cs-section__inner.
     Track sits inside parent left-padding P, so its own padding-left
     = target − P = max(0, (100vw − C) / 2 − P). */
  padding-left: max(0px, calc((100vw - var(--content-body-cs)) / 2 - var(--page-margin)));
  /* Small right gutter; negative margin lets track bleed to page edge */
  padding-right: var(--page-margin);
  margin-right: calc(-1 * var(--page-margin));
  /* Snap target must match padding-left so first card snaps flush */
  scroll-padding-left: max(0px, calc((100vw - var(--content-body-cs)) / 2 - var(--page-margin)));
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE / Edge */
}

.cs-scroll-cards__track::-webkit-scrollbar {
  display: none;               /* Chrome / Safari */
}

/* Specific override for wide cards row */
.cs-scroll-cards--wide .cs-scroll-cards__track {
  width: max-content;
}

.cs-scroll-card {
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  width: 28rem;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}

.cs-scroll-card__img {
  aspect-ratio: 1.21 / 1;
  overflow: hidden;
}

.cs-scroll-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-scroll-card__text {
  padding: 1.75rem 2rem;
}

.cs-scroll-card__text p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--dark);
  line-height: 1.4;
}

/* ── Carousel controls ── */
.cs-scroll-cards__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem auto 0;
  padding: 0 var(--page-margin);
  max-width: calc(var(--content-body-cs) + var(--page-margin) * 2);
}

.cs-scroll-cards__dots {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cs-scroll-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cs-scroll-dot--active {
  background: var(--black);
  transform: scale(1.35);
}

.cs-scroll-arrow {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 1.8px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--black);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.cs-scroll-arrow:hover {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.cs-scroll-arrow:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ════════════════════════════
   CS DEMO
════════════════════════════ */
.cs-demo {
  padding: 1rem var(--page-margin);
}

.cs-demo__inner {
  max-width: var(--content-body);
  margin: 0 auto;
  background: linear-gradient(to right, #08327a, #28adec);
  border-radius: var(--radius-md);
  padding: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30rem;
}

.cs-demo__tv {
  max-width: 90%;
  border-radius: 0.5rem;
  box-shadow: 0 50px 80px rgba(0,0,0,0.33);
}

/* ════════════════════════════
   CS RESULTS
════════════════════════════ */
.cs-results {
  padding: 0 var(--page-margin);
  margin: 0 0 0 0;
}

.cs-results__inner {
  max-width: var(--content-body-cs);
  margin: 0 auto;
  padding: 5rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.cs-results__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.cs-result-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.75rem;
  padding-right: 1rem;
  text-align: center;
  align-items: center;
}

.cs-result-block__label {
  font-family: var(--font-display);
  font-size: var(--text-body);
  color: var(--dark);
}

.cs-result-block__number {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-stat);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--black);
}

.cs-result-block__desc {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--dark);
  line-height: 1.4;
}

.cs-results__secondary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.cs-result-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: top;
  padding: 0.5rem 0;
  text-align: center;
  gap: 0.5rem;
}

.cs-result-badge__emoji {
  font-size: 1.625rem; 
}

.cs-result-badge__text {
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--dark);
  line-height: 1.3;
}

/* ════════════════════════════
   CS CLOSING
════════════════════════════ */
.cs-closing {
  padding: 0 var(--page-margin);
  text-align: center;
}

.cs-closing__inner {
  max-width: var(--content-body);
  margin: 0 auto;
  padding: 5rem 0;
}

.cs-closing__title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--black);
  max-width: 45.5625rem;
  margin: 0 auto 3rem;
}

/* ════════════════════════════
   RESPONSIVE — CASE STUDY
════════════════════════════ */
@media (max-width: 1024px) {
  .cs-insight-box__2col {
    grid-template-columns: 1fr;
  }

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

  /* Cards step down in width; image becomes slightly taller (4:3) */
  .cs-scroll-card {
    width: 25rem;
  }

  .cs-scroll-card__img {
    aspect-ratio: 1.21 / 1;
  }
}

@media (max-width: 767px) {
  .cs-hero-img__wrap {
    height: 16rem;
  }

  .cs-details__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

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

  .cs-results__stats {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

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

  /* Carousel stays horizontal on mobile — cards nearly fill the screen
     with enough room to hint the next card (≈ page-margin + gap peek) */
  .cs-scroll-card {
    width: calc(100vw - var(--page-margin) - 2.5rem);
  }

  .cs-scroll-card__text {
    padding: 1.25rem 1.5rem;
  }

  .cs-insight-box__inner {
    padding: 1.5rem;
  }

  .cs-insight-box__stats-row {
    grid-template-columns: 1fr;
  }

  .cs-quote__text {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
  }

  .cs-quote__wrap {
    padding: 2rem 1.5rem;
    height: auto;
    min-height: 20rem;
  }
}
