/* ============================================================
   CASE STUDY LAYOUT
   ============================================================ */

.cs-container {
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* ---- Header: title + hero ---- */

.cs-header {
  padding-top: 160px;
}

.cs-header .cs-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.cs-header-text {
  max-width: calc(8 / 12 * 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cs-brand {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  margin: 0;
}

.cs-title {
  font-family: var(--font-display);
  font-size: var(--h2);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.cs-hero-wrap {
  width: 100%;
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 80px;
}

.cs-hero-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---- Text styles ---- */

.cs-lead {
  font-family: var(--font-text);
  font-size: 24px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--text);
}

.secondary {
  color: var(--text-secondary);
}

/* ---- Quote block ---- */

.cs-quote {
  aspect-ratio: 1 / 1;
  background: var(--frame-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* ---- Problem grid ---- */

.cs-problem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  width: calc(10 / 8 * 100%);
  margin-inline: calc(-1 / 8 * 100%);
}

.cs-problem-grid-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cs-problem-img {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
}

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

/* ---- Screen strip ---- */

.cs-screen-strip {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 40px;
  background: var(--frame-bg);
  border-radius: 8px;
}

.cs-screen-strip-title {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--text);
  margin: 0;
}

.cs-screen-strip-images {
  display: flex;
  gap: 40px;
}

.cs-screen-strip-images > img {
  flex: 1;
  min-width: 0;
  height: auto;
  border-radius: var(--radius-2);
  display: block;
}

.cs-screen-strip-item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
}

.cs-screen-strip-item img {
  height: 500px;
  width: auto;
  max-width: 100%;
  border-radius: var(--radius-2);
  display: block;
}

.cs-screen-strip-item-label {
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

/* ---- Compare columns ---- */

.cs-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  width: calc(10 / 8 * 100%);
  margin-inline: calc(-1 / 8 * 100%);
}

.cs-compare--3col {
  grid-template-columns: 1fr 1fr 1fr;
}

.cs-compare--3col-single {
  display: flex;
  flex-direction: row;
  gap: var(--space-5);
  width: calc(10 / 8 * 100%);
  margin-inline: calc(-1 / 8 * 100%);
}

.cs-compare--3col-single img {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-2);
}

.cs-compare-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--frame-bg);
  border-radius: 8px;
  padding: 40px;
}

.cs-compare-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-compare-images {
  display: flex;
  gap: var(--space-3);
}

.cs-compare-images img {
  flex: 1;
  min-width: 0;
  height: auto;
  border-radius: var(--radius-2);
  display: block;
}

.cs-compare-label {
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

.cs-compare-body {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- Lists ---- */

.cs-list {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--text-secondary);
  padding-left: 1.2em;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ---- Mini bento ---- */

.cs-mini-bento {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-3);
}

.cs-mini-bento-cell {
  border-radius: var(--radius-2);
  overflow: hidden;
  background: var(--surface);
  display: flex;
}

.cs-mini-bento-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Left col: two small squares */
.cs-mini-bento-cell--small {
  aspect-ratio: 1 / 1;
}

/* Right col: fills the full height of both left rows + gap */
.cs-mini-bento-cell--large {
  grid-column: 2;
  grid-row: 1 / 3;
}

/* ---- Body: nav + content ---- */

.cs-body {
  padding-bottom: var(--space-9);
}

.cs-body-inner {
  position: relative;
}

/* ---- Sticky left nav ---- */

.cs-nav {
  position: fixed;
  top: 80px;
  /* left: calc((100vw - 1400px) / 2 + var(--space-6)); */
  width: 160px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.cs-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.cs-nav-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.cs-nav-link {
  display: block;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  padding: var(--space-2) 0;
  text-align: left;
  cursor: pointer;
  transition: color 150ms ease;
  line-height: 1.3;
}

.cs-nav-link:hover {
  color: var(--text);
}

.cs-nav-link.is-active {
  color: var(--text);
}

/* ---- Content area ---- */

.cs-content {
  max-width: calc(8 / 12 * 100%);
  margin-inline: auto;
  padding-top: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: 160px;
}

/* ---- Meta block (team / role / outcomes) ---- */

.cs-meta {
  display: flex;
  gap: var(--space-8);
  padding-bottom: var(--space-7);
  padding-top: var(--space-7);
  margin-bottom: var(--space-9);

  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.cs-meta-label {
  font-weight: 500;
  color: var(--text);
  margin: 0 0 var(--space-2);
}

.cs-meta-value {
  margin: 0;
  line-height: 1.6;
}

/* ---- Section text rhythm ---- */

/* 48px between all top-level blocks within a section */
.cs-section {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* 24px between copy elements inside a text block */
.cs-section .cs-block--8,
.cs-section .vstack-lg {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* h2 always gets 48px of space after it — gap covers 24px, margin adds the other 24px */
.cs-section .h2,
.cs-section h2 {
  margin-bottom: 24px;
}

.cs-section .cs-lead,
.cs-section .body,
.cs-section .body-title,
.cs-section .cs-list {
  padding-right: 112px;
}

/* ---- Content blocks ---- */

.cs-block {
  width: 100%;
}

.cs-block--8,
.cs-block--12 {
  max-width: 100%;
}

/* breakout-10 must win over the cs-block width/max-width above */
.cs-block.breakout-10 {
  width: calc(10 / 8 * 100%);
  max-width: calc(10 / 8 * 100%);
  margin-inline: calc(-1 / 8 * 100%);
}

.cs-block img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-2);
}

/* ---- Carousel ---- */

.bento-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
}

.bento-carousel-track {
  display: flex;
  will-change: transform;
}

.bento-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.bento-carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  pointer-events: none;
  user-select: none;
}

.bento-carousel-pagination {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 10px;
  border-radius: 999px;
}

.bento-carousel-pagination .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  padding: 0;
  cursor: pointer;
  transition:
    background 200ms ease,
    transform 200ms ease;
}

.bento-carousel-pagination .dot.is-active {
  background: #fff;
  transform: scale(1.2);
}

/* ---- Phone before/after compare ---- */

.cs-phone-3col {
  display: flex;
  gap: 40px;
  width: calc(10 / 8 * 100%);
  margin-inline: calc(-1 / 8 * 100%);
}

.cs-phone-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--frame-bg);
  border-radius: 8px;
  padding: 40px;
}

.cs-ba-toggle {
  display: inline-flex;
  align-self: center;
  background: var(--surface);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.cs-ba-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.cs-ba-btn.is-active {
  background: var(--bg);
  color: var(--text);
}

.cs-phone-img-wrap {
  position: relative;
  align-self: center;
  width: 100%;
}

.cs-phone-img-wrap img,
.cs-phone-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-2);
}

.cs-phone-img-wrap img[data-ba="old"] {
  position: absolute;
  top: 0;
  left: 0;
}

.cs-phone-pair {
  display: flex;
  gap: 16px;
  width: 100%;
}

.cs-phone-pair .cs-phone-img-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cs-phone-tag {
  display: inline-block;
  align-self: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

@media (max-width: 900px) {
  .cs-section .h2,
  .cs-section h2 {
    margin-bottom: 0px;
  }

  .cs-nav {
    display: none;
  }

  .cs-content {
    max-width: 100%;
    gap: 80px;
  }

  .cs-section {
    gap: 40px;
  }

  .cs-block--12 {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    gap: 16px;
  }

  .cs-header {
    padding-top: 120px;
  }

  .cs-hero-wrap {
    margin-bottom: 24px;
  }

  .cs-header-text {
    max-width: 100%;
  }

  .cs-compare {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
  }
}

.no-pad {
  padding-right: 0px !important;
}

.light-bg {
  background-color: #eee;
}

.dark-bg {
  background-color: #222;
  border-radius: 16px;
  padding-top: 16px;
}

.side-heading {
  margin-top: 80px;
}
