/* ============================================================
   casestudy.css — shared styles for all case study pages
   ============================================================ */

/* ── Layout ── */
.cs-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 32px 120px;
}

/* ── Hero ── */
.cs-hero {
  width: 100%;
  margin-top: 80px;
  position: relative;
}

.cs-hero img {
  width: 100%;
  border-radius: 0px;
  display: block;
  object-fit: cover;
}

/* ── Title block ── */
.cs-title-block {
  padding: 48px 0 8px;
  border-bottom: 0.5px solid #522b12;
  margin-bottom: 48px;
}

.cs-eyebrow {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #522b12;
  margin: 0 0 12px;
}

.cs-title-block h1 {
  font-size: 42px;
  line-height: 1.15;
  max-width: 620px;
  margin-bottom: 16px;
}

.cs-subtitle {
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  color: #444;
  max-width: 560px;
  line-height: 1.6;
  margin: 0 0 28px;
}

/* ── Meta row ── */
.cs-meta {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-bottom: 0.5px solid #52291222;
  margin-bottom: 64px;
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-meta-label {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #522b12;
}

.cs-meta-value {
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  color: #111;
  max-width: none;
}

/* ── Section headings ── */
.cs-section {
  margin-bottom: 64px;
}

.cs-section-label {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #522b12;
  margin: 0 0 12px;
}

.cs-section h2 {
  font-size: 28px;
  padding: 0 0 16px;
  margin: 0;
}

.cs-body {
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #222;
  max-width: none;
  margin: 0 0 16px;
}

/* ── Callout / pull quote ── */
.cs-callout {
  border-left: 3px solid #522b12;
  background: #52291208;
  padding: 20px 24px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}

.cs-callout p {
  font-family: "Libre italic", serif;
  font-size: 18px;
  line-height: 1.6;
  color: #111;
  max-width: none;
  margin: 0;
}

/* ── Two-column cards ── */
.cs-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.cs-card {
  background: #52291208;
  border: 0.5px solid #52291230;
  border-radius: 12px;
  padding: 24px;
}

.cs-card h3 {
  font-family: "Libre italic", serif;
  font-size: 16px;
  font-weight: 900;
  color: #522b12;
  margin: 0 0 10px;
  padding: 0;
}

.cs-card p {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  max-width: none;
  margin: 0;
}

/* ── Numbered / arrow list ── */
.cs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #222;
}

.cs-list li .num {
  font-family: "Libre italic", serif;
  font-size: 18px;
  color: #522b12;
  flex-shrink: 0;
  min-width: 22px;
  padding-top: 1px;
}

/* ── Images ── */
.cs-img {
  width: 100%;
  border-radius: 12px;
  display: block;
  margin: 28px 0;
  border: 0.5px solid #52291215;
}

.cs-img-caption {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  color: #747474; /* was #777 — 4.35:1, just under WCAG AA; this clears 4.5:1 */
  margin: -16px 0 28px;
  max-width: none;
}

/* ── Divider ── */
.cs-divider {
  border: none;
  border-top: 0.5px solid #52291220;
  margin: 64px 0;
}

/* ── Back link ── */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #522b12;
  text-decoration: none;
  padding-top: 20px;
  margin-bottom: 0;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.cs-back:hover {
  opacity: 1;
}

/* ── End-of-case-study actions: next case study / playground ──
   Deliberately quieter than the homepage's solid .btn — outlined,
   not filled, so they read as secondary next-step links rather
   than another primary call to action. */
.cs-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid rgba(82, 43, 18, 0.14);
}

.cs-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border: 1.5px solid rgba(82, 43, 18, 0.35);
  border-radius: 100px;
  font-family: "Libre", serif;
  font-weight: 700;
  font-size: 15px;
  color: #522b12;
  text-decoration: none;
  background: transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.cs-secondary-btn:hover {
  background-color: rgba(82, 43, 18, 0.06);
  border-color: rgba(82, 43, 18, 0.55);
}

.cs-secondary-btn .cs-secondary-arrow {
  transition: transform 0.2s ease;
}

.cs-secondary-btn:hover .cs-secondary-arrow {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .cs-next-actions {
    flex-direction: column;
    gap: 12px;
  }
  .cs-secondary-btn {
    justify-content: center;
  }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .cs-wrap {
    padding: 0 20px 80px;
  }

  .cs-title-block h1 {
    font-size: 28px;
  }

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

  .cs-meta {
    gap: 20px;
  }
}

/* ============================================================
   Price Insights — page-specific styles
   ============================================================ */

/* ── Outcome stats ── */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.cs-stat {
  background: #522b12;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  color: #fffced;
}

.cs-stat-number {
  font-family: "Libre italic", serif;
  font-size: 36px;
  font-weight: 900;
  display: block;
  margin-bottom: 6px;
  color: #fffced;
}

.cs-stat-label {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #ffe8d0;
  max-width: none;
  margin: 0;
}

/* ── Business value list ── */
.cs-biz-item {
  padding: 20px 0;
  border-bottom: 0.5px solid #52291220;
}

.cs-biz-item:last-child {
  border-bottom: none;
}

.cs-biz-item h4 {
  font-family: "Libre italic", serif;
  font-size: 17px;
  color: #111;
  margin: 0 0 6px;
  padding: 0;
}

.cs-biz-item p {
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #444;
  max-width: none;
  margin: 0;
}

/* ── Research highlight grid ── */
.cs-research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.cs-research-item {
  padding: 20px;
  background: #1c16130f;
  border-radius: 12px;
}

.cs-research-item h4 {
  font-family: "Libre italic", serif;
  font-size: 15px;
  color: #111;
  margin: 0 0 6px;
  padding: 0;
}

.cs-research-item p {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  max-width: none;
  margin: 0;
}

/* ============================================================
   Table Pivot — page-specific styles
   ============================================================ */

/* ── Three-column cards ── */
.cs-cards-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

/* ── Copy exploration row ── */
.cs-copy-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
  border: 0.5px solid #52291225;
  border-radius: 12px;
  overflow: hidden;
}

.cs-copy-item {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 0.5px solid #52291215;
}

.cs-copy-item:last-child {
  border-bottom: none;
}

.cs-copy-word {
  font-family: "Libre italic", serif;
  font-size: 18px;
  color: #522b12;
  min-width: 90px;
  flex-shrink: 0;
}

.cs-copy-item p {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  max-width: none;
  margin: 0;
}

.cs-copy-item.winner {
  background: #d1eae4;
}

.cs-copy-item.winner .cs-copy-word {
  color: #307436;
}

/* ── Scenario table ── */
.cs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
}

.cs-table th {
  background: #522b12;
  color: #fffced;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
}

.cs-table td {
  padding: 10px 14px;
  border-bottom: 0.5px solid #52291215;
  color: #222;
  vertical-align: top;
  line-height: 1.5;
}

.cs-table tr:nth-child(even) td {
  background: #52291206;
}

/* ── Insight block ── */
.cs-insight {
  background: #d1eae4;
  border-radius: 12px;
  padding: 20px 24px;
  margin: 12px 0;
}

.cs-insight p {
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #222;
  max-width: none;
  margin: 0;
}

.cs-insight strong {
  color: #307436;
}

/* ============================================================
   Key Driver Analysis — page-specific styles
   ============================================================ */

/* ── Version comparison ── */
.cs-version-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.cs-version {
  border-radius: 12px;
  padding: 24px;
}

.cs-version.old {
  background: #f5f0eb;
  border: 0.5px solid #d4b89830;
}

.cs-version.new {
  background: #d4b89830;
  border: 0.5px solid #745d30aa;
}

.cs-version h4 {
  font-family: "Libre italic", serif;
  font-size: 15px;
  margin: 0 0 10px;
  padding: 0;
}

.cs-version.old h4 {
  color: #888;
}
.cs-version.new h4 {
  color: #522b12;
}

.cs-version p {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
  max-width: none;
  margin: 0;
}

/* ── Exploration progression ── */
.cs-exploration {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 24px 0;
  border: 0.5px solid #52291220;
  border-radius: 12px;
  overflow: hidden;
}

.cs-exp-item {
  display: flex;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 0.5px solid #52291215;
  align-items: flex-start;
}

.cs-exp-item:last-child {
  border-bottom: none;
}

.cs-exp-step {
  font-family: "Libre italic", serif;
  font-size: 22px;
  color: #52291240;
  min-width: 28px;
  padding-top: 2px;
  flex-shrink: 0;
}

.cs-exp-content h4 {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #111;
  margin: 0 0 4px;
  padding: 0;
}

.cs-exp-content p {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  max-width: none;
  margin: 0;
}

.cs-exp-item.winner {
  background: #b1d6b562;
}

.cs-exp-item.winner .cs-exp-step {
  color: #307436;
}
.cs-exp-item.winner .cs-exp-content h4 {
  color: #307436;
}

/* ── Why waterfall reasons ── */
.cs-reason {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 0.5px solid #52291215;
  align-items: flex-start;
}

.cs-reason:last-child {
  border-bottom: none;
}

.cs-reason-icon {
  font-size: 18px;
  flex-shrink: 0;
  padding-top: 2px;
}

.cs-reason p {
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #222;
  max-width: none;
  margin: 0;
}

/* ── Iteration diff ── */
.cs-diff {
  background: #52291208;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

.cs-diff h4 {
  font-family: "Libre italic", serif;
  font-size: 16px;
  color: #522b12;
  margin: 0 0 16px;
  padding: 0;
}

.cs-diff-item {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

.cs-diff-item:last-child {
  margin-bottom: 0;
}

.cs-diff-item .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  height: fit-content;
  margin-top: 2px;
}

.tag.removed {
  background: #fde8e8af;
  color: #c0392b;
}
.tag.changed {
  background: #bfffc66a;
  color: #307436;
}

/* ── Learnings ── */
.cs-learning {
  padding: 20px 0;
  border-bottom: 0.5px solid #52291215;
}

.cs-learning:last-child {
  border-bottom: none;
}

.cs-learning h4 {
  font-family: "Libre italic", serif;
  font-size: 17px;
  color: #111;
  margin: 0 0 6px;
  padding: 0;
}

.cs-learning p {
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #444;
  max-width: none;
  margin: 0;
}

/* ── Exploration item image ── */
.cs-exp-img {
  width: 100%;
  border-radius: 8px;
  display: block;
  margin-top: 12px;
  border: 0.5px solid #52291215;
  background: #fff;
}

/* ── Before / After comparison ── */
.cs-before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

.cs-before-after figure {
  margin: 0;
}

.cs-before-after img {
  width: 100%;
  border-radius: 10px;
  display: block;
  border: 0.5px solid #52291215;
}

.cs-before-after figcaption {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  color: #777;
  margin-top: 8px;
  text-align: center;
}

/* ── Full-width dark image (product screenshots) ── */
.cs-img-dark {
  width: 100%;
  border-radius: 12px;
  display: block;
  margin: 28px 0;
  background: #111;
}

/* ── Tooltip pair ── */
.cs-tooltip-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.cs-tooltip-pair figure {
  margin: 0;
}

.cs-tooltip-pair img {
  width: 100%;
  border-radius: 10px;
  display: block;
  border: 0.5px solid #52291215;
}

.cs-tooltip-pair figcaption {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  color: #777;
  margin-top: 8px;
  text-align: center;
}

@media (max-width: 640px) {
  .cs-before-after,
  .cs-tooltip-pair {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Responsive — page-specific overrides
   ============================================================ */
@media (max-width: 640px) {
  .cs-stats,
  .cs-research-grid {
    grid-template-columns: 1fr;
  }

  .cs-stat-number {
    font-size: 28px;
  }

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

  .cs-table {
    font-size: 12px;
  }

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

/* ── Mobile screenshot frame (portrait phone on white landscape bg) ── */
.cs-mobile-frame {
  background: #ffffff;
  border-radius: 16px;
  padding: 48px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  border: 0.5px solid #52291215;
  margin: 28px 0;
  overflow: hidden;
}

.cs-mobile-frame img {
  height: 460px;
  width: auto;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: block;
}

/* ── Looping video (full width) ── */
.cs-video {
  width: 100%;
  border-radius: 12px;
  display: block;
  margin: 28px 0;
}

/* ── Looping video (mobile frame) ── */
.cs-video-mobile {
  background: #ffffff;
  border-radius: 16px;
  padding: 48px 40px;
  display: flex;
  justify-content: center;
  gap: 32px;
  border: 0.5px solid #52291215;
  margin: 28px 0;
}

.cs-video-mobile video {
  height: 460px;
  width: auto;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ── Side-by-side wireframes ── */
.cs-wf-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

.cs-wf-pair figure {
  margin: 0;
}

.cs-wf-pair img {
  width: 100%;
  border-radius: 8px;
  display: block;
  border: 0.5px solid #52291215;
}

.cs-wf-pair figcaption {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  color: #777;
  margin-top: 8px;
  text-align: center;
}

@media (max-width: 640px) {
  .cs-mobile-frame {
    padding: 28px 16px;
    gap: 16px;
  }
  .cs-mobile-frame img {
    height: 300px;
  }
  .cs-video-mobile {
    padding: 28px 16px;
  }
  .cs-video-mobile video {
    height: 300px;
  }
  .cs-wf-pair {
    grid-template-columns: 1fr;
  }
}

/* ── Side nav (scroll map) ── */
.cs-sidenav {
  position: fixed;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 100;
  pointer-events: none;
}

.cs-sidenav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: all;
  cursor: pointer;
  padding: 3px 0;
}

.cs-sidenav-tick {
  display: block;
  height: 1px;
  background: #52291240;
  transition:
    background 0.2s ease,
    width 0.2s ease;
  flex-shrink: 0;
}

.cs-sidenav-item[data-level="1"] .cs-sidenav-tick {
  width: 20px;
}
.cs-sidenav-item[data-level="2"] .cs-sidenav-tick {
  width: 12px;
}
.cs-sidenav-item[data-level="3"] .cs-sidenav-tick {
  width: 7px;
}

.cs-sidenav-label {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #522b12;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(6px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  margin-right: 10px;
  text-align: right;
  pointer-events: none;
}

.cs-sidenav-item:hover .cs-sidenav-label {
  opacity: 1;
  transform: translateX(0);
}

.cs-sidenav-item.active .cs-sidenav-tick {
  background: #522b12;
}

.cs-sidenav-item[data-level="1"].active .cs-sidenav-tick {
  width: 24px;
}
.cs-sidenav-item[data-level="2"].active .cs-sidenav-tick {
  width: 16px;
}
.cs-sidenav-item[data-level="3"].active .cs-sidenav-tick {
  width: 10px;
}

.cs-sidenav-item:hover .cs-sidenav-tick {
  background: #522b12;
}

@media (max-width: 1100px) {
  .cs-sidenav {
    display: none;
  }
}
