/* ─────────────────────────────────────────────
   CASE STUDY LAYOUT
   ──────────────────────────────────────────── */

.cs-wrap { padding-top: 68px; } /* space for fixed nav */

/* ── HERO ── */
.cs-hero {
  position: relative;
  height: clamp(520px, 78vh, 760px);
  display: flex; align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}
.cs-back {
  position: absolute; top: 32px; left: 0; right: 0;
  z-index: 3;
  pointer-events: none;
}
.cs-back-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 0 52px;
}
.cs-back-link {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'SF Mono', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.78); text-decoration: none;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.cs-back-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.08);
}
.cs-back-link .cs-back-arrow { transition: transform .25s; display: inline-block; }
.cs-back-link:hover .cs-back-arrow { transform: translateX(-3px); }
@media (max-width: 960px) {
  .cs-back-inner { padding: 0 32px; }
}
.cs-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .55;
}
.cs-hero-tint {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(34,61,74,.25) 0%, rgba(34,61,74,.85) 100%);
}
.cs-hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1320px;
  margin: 0 auto; padding: 0 52px 64px;
  color: #fff;
}
.cs-hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'SF Mono', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.cs-hero-tag::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(180,216,0,.18);
  animation: pulse 2s infinite;
}
.cs-hero-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400; font-size: clamp(40px, 5.5vw, 84px);
  line-height: 1.04; letter-spacing: -.02em;
  color: #fff;
  max-width: 18ch;
}
.cs-hero-title em { font-style: italic; color: rgba(255,255,255,.78); }
.cs-hero-sub {
  margin-top: 18px;
  font-size: 17px; line-height: 1.55;
  color: rgba(255,255,255,.72);
  max-width: 56ch;
}
.cs-hero-meta-tag {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 22px;
  font-family: 'SF Mono', monospace;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

/* ── META BAR ── */
.cs-meta {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.cs-meta-inner {
  max-width: 1320px; margin: 0 auto;
  padding: 36px 52px;
  display: flex; flex-wrap: wrap;
  gap: 24px 56px;
}
.cs-meta-cell { flex: 0 1 auto; min-width: 0; }
.cs-meta-cell { display: flex; flex-direction: column; gap: 6px; }
.cs-meta-label {
  font-family: 'SF Mono', monospace;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3);
}
.cs-meta-val { font-size: 15px; color: var(--ink); font-weight: 500; }

/* ── SECTION ── */
.cs-section { padding: 100px 0; }
.cs-section.alt   { background: var(--bg2); }
.cs-section.dark  { background: var(--ink); color: rgba(255,255,255,.85); }
.cs-section.dark .cs-eyebrow { color: var(--accent); }
.cs-section.dark .cs-section-title { color: #fff; }
.cs-inner { max-width: 1320px; margin: 0 auto; padding: 0 52px; }

.cs-eyebrow {
  font-family: 'SF Mono', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.cs-eyebrow::before {
  content: ''; width: 28px; height: 1px; background: currentColor;
  display: inline-block;
}
.cs-section-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400; font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.1; letter-spacing: -.015em;
  color: var(--ink);
  max-width: 22ch;
}
.cs-body {
  margin-top: 24px;
  font-size: 17px; line-height: 1.7;
  color: var(--ink2);
  max-width: 64ch;
}
.cs-body + .cs-body { margin-top: 18px; }
.cs-section.dark .cs-body { color: rgba(255,255,255,.7); }

.cs-figure {
  margin-top: 56px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg2);
  box-shadow: 0 12px 40px rgba(34,61,74,.06);
}
.cs-figure img { width: 100%; height: auto; display: block; }
.cs-figure-caption {
  padding: 14px 22px;
  font-size: 12px; color: var(--ink3);
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-family: 'SF Mono', monospace; letter-spacing: .04em;
}

.cs-quote {
  margin-top: 56px;
  padding: 44px 56px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic; font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.35; color: var(--ink);
  max-width: 72ch;
}
.cs-quote-cite {
  display: block; margin-top: 16px;
  font-family: 'SF Mono', monospace;
  font-style: normal; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink3);
}

/* ── PAIN POINTS / EDGE CARDS / DECISION CARDS ── */
.cs-cards {
  margin-top: 56px;
  display: grid; gap: 16px;
}
.cs-cards.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cs-cards.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cs-cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cs-cards.cols-5 { grid-template-columns: repeat(5, 1fr); }
.cs-cards.cols-5 .cs-card { padding: 22px; }

/* Inline section header — eyebrow + title side by side on one row */
.cs-header-inline {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 24px 40px;
  margin-bottom: 32px;
}
.cs-header-inline .cs-eyebrow { margin-bottom: 0; flex-shrink: 0; }
.cs-header-inline .cs-section-title { margin: 0; }

/* Two-column body layout (paragraphs side by side) */
.cs-cols-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 24px;
}
.cs-cols-2 .cs-body { margin-top: 0; max-width: none; }
.cs-cols-2 .cs-figure {
  margin-top: 0;
  display: flex;
  flex-direction: column;
}
.cs-cols-2 .cs-figure img {
  flex: 1;
  min-height: 0;
  object-fit: cover;
}
.cs-cols-2 .cs-decisions { margin-top: 0; }

/* Stacked variant of cs-decisions — each item title above body (for narrow columns) */
.cs-decisions.stack .cs-decision { grid-template-columns: 1fr; gap: 10px; }
.cs-decisions.stack .cs-decision-title { font-size: clamp(18px, 1.6vw, 22px); }
.cs-decisions.stack .cs-decision-body { font-size: 14px; }

/* Two-column flow within a single paragraph */
.cs-body.two-col {
  column-count: 2;
  column-gap: 48px;
  max-width: none;
}

/* Split: text + figure side by side, figure column wider */
.cs-split {
  display: grid; grid-template-columns: 1fr 2.4fr;
  gap: 48px; align-items: start;
  margin-top: 32px;
}
.cs-split .cs-figure { margin-top: 0; }
.cs-split .cs-body { margin-top: 0; max-width: none; }

@media (max-width: 640px) {
  .cs-cols-2,
  .cs-split { grid-template-columns: 1fr; gap: 24px; }
  .cs-body.two-col { column-count: 1; }
}

/* Sub-heading inside a section (used for "Stakeholder walkthroughs" etc.) */
.cs-subhead {
  margin-top: 48px;
  margin-bottom: 14px;
  font-size: 20px; font-weight: 600; letter-spacing: -.015em;
  color: var(--ink);
}
.cs-subhead:first-of-type { margin-top: 36px; }
.cs-section.dark .cs-subhead { color: #fff; }

/* Bullet list (used for "where is the driver" etc., alternatives, pain bullets) */
.cs-list {
  margin-top: 22px; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 16px; line-height: 1.65; color: var(--ink2);
  max-width: 70ch;
  list-style: none;
}
.cs-list li {
  position: relative; padding-left: 28px;
}
.cs-list li::before {
  content: ''; position: absolute; left: 0; top: 11px;
  width: 14px; height: 1px; background: var(--accent);
}
.cs-section.dark .cs-list { color: rgba(255,255,255,.7); }

.cs-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.cs-card:hover { border-color: rgba(34,61,74,.25); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(34,61,74,.06); }
.cs-card-num {
  font-family: 'SF Mono', monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  color: var(--accent-dark);
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 3px 9px;
  align-self: flex-start;
}
.cs-card-title {
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  line-height: 1.35; color: var(--ink);
}
.cs-card-body {
  font-size: 14px; line-height: 1.65; color: var(--ink2);
}

/* Dark variant for cards on dark sections */
.cs-section.dark .cs-card {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.1);
}
.cs-section.dark .cs-card:hover { border-color: rgba(180,216,0,.35); box-shadow: 0 10px 28px rgba(0,0,0,.2); }
.cs-section.dark .cs-card-title { color: #fff; }
.cs-section.dark .cs-card-body { color: rgba(255,255,255,.65); }
.cs-section.dark .cs-card-num {
  background: rgba(180,216,0,.12);
  border-color: rgba(180,216,0,.4);
  color: var(--accent);
}

/* ── PRINCIPLES (large numbered rows) ── */
.cs-principles { margin-top: 56px; display: flex; flex-direction: column; }
.cs-principle {
  display: grid; grid-template-columns: 80px 1fr; gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.cs-principle:last-child { border-bottom: 1px solid var(--border); }
.cs-principle-num {
  font-family: 'SF Mono', monospace;
  font-size: 13px; font-weight: 600; letter-spacing: .1em;
  color: var(--accent-dark);
}
.cs-principle-title {
  font-size: clamp(20px, 1.8vw, 26px); font-weight: 600;
  letter-spacing: -.015em; line-height: 1.25;
  color: var(--ink);
  margin-bottom: 10px;
}
.cs-principle-body { font-size: 15px; line-height: 1.7; color: var(--ink2); max-width: 70ch; }

/* ── DECISIONS (heading + body alternating) ── */
.cs-decisions { margin-top: 56px; display: flex; flex-direction: column; gap: 0; }
.cs-decision {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 48px;
  align-items: start;
}
.cs-decision:last-child { border-bottom: 1px solid var(--border); }
.cs-decision-num {
  font-family: 'SF Mono', monospace;
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.cs-decision-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400; font-style: italic;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.25; color: var(--ink);
  letter-spacing: -.005em;
}
.cs-decision-body { font-size: 15px; line-height: 1.7; color: var(--ink2); }

/* ── BEFORE / AFTER ── */
.cs-ba {
  margin-top: 56px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cs-ba-block {
  padding: 36px 32px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.cs-ba-block.after  { background: var(--ink); color: #fff; border-color: var(--ink); }
.cs-ba-label {
  font-family: 'SF Mono', monospace;
  font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 14px;
}
.cs-ba-block.after .cs-ba-label { color: var(--accent); }
.cs-ba-text { font-size: 15px; line-height: 1.7; color: var(--ink2); }
.cs-ba-block.after .cs-ba-text { color: rgba(255,255,255,.78); }

/* ── EDGE CASE SHOWCASE (state 4a vs 4b comparison) ── */
.cs-edge-showcase {
  margin-top: 56px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.cs-edge-showcase-header {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
}
.cs-edge-showcase-header-title {
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.cs-edge-showcase-header-sub {
  font-size: 13px; color: var(--ink2);
  line-height: 1.45;
}

.cs-edge-showcase-body {
  padding: 56px 32px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 0 32px;
}
.cs-edge-showcase-col {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.cs-edge-showcase-phone {
  width: 100%; max-width: 260px;
  margin-bottom: 24px;
}
.cs-edge-showcase-phone img {
  width: 100%; height: auto; display: block;
}
.cs-edge-showcase-caption-title {
  font-size: 14px; font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.cs-edge-showcase-caption-body {
  font-size: 13px; color: var(--ink2);
  line-height: 1.5;
}

.cs-edge-showcase-vs {
  position: relative;
  align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  width: 56px;
  margin-bottom: 80px; /* don't extend past the phones */
}
.cs-edge-showcase-vs::before {
  content: ''; position: absolute;
  top: 24px; bottom: 24px; left: 50%;
  width: 1px;
  background: var(--border);
  transform: translateX(-50%);
}
.cs-edge-showcase-vs-label {
  position: relative; z-index: 2;
  background: var(--bg);
  padding: 8px 0;
  font-family: 'SF Mono', monospace;
  font-size: 12px; font-weight: 500;
  color: var(--ink3);
  letter-spacing: .06em;
}

.cs-edge-showcase-footer {
  border-top: 1px solid var(--border);
  padding: 24px 28px 28px;
}
.cs-edge-showcase-footer-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding-bottom: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.cs-edge-showcase-footer-grid > div {
  font-size: 12px; color: var(--ink2);
  line-height: 1.55;
}
.cs-edge-showcase-footer-grid > div:first-child {
  border-right: 1px solid var(--border);
  padding-right: 32px;
}
.cs-edge-showcase-footer-note {
  font-size: 13px; font-weight: 500;
  color: var(--ink);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .cs-edge-showcase-body {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    gap: 28px 0;
  }
  .cs-edge-showcase-vs { margin: 0; height: 40px; width: 100%; }
  .cs-edge-showcase-vs::before {
    top: 50%; bottom: auto; left: 24px; right: 24px; width: auto; height: 1px;
    transform: none;
  }
  .cs-edge-showcase-footer-grid {
    grid-template-columns: 1fr; gap: 20px;
  }
  .cs-edge-showcase-footer-grid > div:first-child {
    border-right: none; padding-right: 0;
    border-bottom: 1px solid var(--border); padding-bottom: 20px;
  }
}

/* ── CTA STRIP ── */
.cs-cta {
  background: var(--bg); padding: 80px 0;
  border-top: 1px solid var(--border);
}
.cs-cta-eyebrow {
  font-family: 'SF Mono', monospace;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3); margin-bottom: 12px;
}
.cs-cta-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
}
.cs-cta-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic; font-weight: 400;
  font-size: clamp(28px, 3vw, 44px);
  color: var(--ink);
  margin: 0;
}

/* Next case study link */
.cs-next {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.cs-next-label {
  font-family: 'SF Mono', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink3);
}
.cs-next-link {
  display: inline-flex; align-items: center; gap: 16px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(22px, 2.4vw, 32px);
  font-style: italic; font-weight: 400;
  color: var(--ink); text-decoration: none;
  letter-spacing: -.005em;
  transition: gap .25s, color .2s;
}
.cs-next-link:hover {
  color: var(--accent-dark);
  gap: 24px;
}
.cs-next-arrow {
  font-size: 1.4em;
  display: inline-block;
  transition: transform .25s;
}
.cs-next-link:hover .cs-next-arrow { transform: translateX(4px); }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .cs-meta-inner { grid-template-columns: repeat(2, 1fr); }
  .cs-cards.cols-3, .cs-cards.cols-4, .cs-cards.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .cs-decision { grid-template-columns: 1fr; gap: 16px; }
  .cs-ba { grid-template-columns: 1fr; }
  .cs-section { padding: 72px 0; }
  .cs-inner { padding: 0 32px; }
  .cs-hero-inner { padding: 0 32px 48px; }
  .cs-meta-inner { padding: 28px 32px; column-gap: 24px; }
}
@media (max-width: 600px) {
  /* Tighter section padding */
  .cs-section { padding: 56px 0; }
  .cs-inner { padding: 0 20px; }

  /* Hero */
  .cs-hero { height: clamp(440px, 70vh, 560px); }
  .cs-hero-inner { padding: 0 20px 32px; }
  .cs-hero-tag { font-size: 10px; margin-bottom: 12px; }
  .cs-hero-title { font-size: clamp(34px, 9.5vw, 52px); line-height: 1.05; }
  .cs-hero-sub { font-size: 15px; margin-top: 14px; line-height: 1.5; }
  .cs-back { top: 18px; }
  .cs-back-inner { padding: 0 20px; }
  .cs-back-link { font-size: 10px; padding: 6px 12px; gap: 6px; }

  /* Meta — single column stack */
  .cs-meta-inner {
    grid-template-columns: 1fr;
    padding: 22px 20px;
    gap: 16px 0;
    display: flex; flex-direction: column;
  }
  .cs-meta-cell { gap: 4px; }
  .cs-meta-val { font-size: 14px; }

  /* Cards */
  .cs-cards.cols-2,
  .cs-cards.cols-3,
  .cs-cards.cols-4,
  .cs-cards.cols-5 { grid-template-columns: 1fr; gap: 12px; }
  .cs-card { padding: 22px; }
  .cs-card-title { font-size: 16px; }
  .cs-card-body { font-size: 13px; }

  /* Decisions list */
  .cs-decision { padding: 24px 0; gap: 8px; }
  .cs-decision-title { font-size: clamp(20px, 5.5vw, 26px); }
  .cs-decision-body { font-size: 14px; }

  /* Principles list */
  .cs-principle { grid-template-columns: 48px 1fr; gap: 12px; padding: 24px 0; }
  .cs-principle-title { font-size: clamp(18px, 5vw, 22px); }
  .cs-principle-body { font-size: 14px; }

  /* Section title + body */
  .cs-section-title { font-size: clamp(28px, 8vw, 40px); line-height: 1.1; }
  .cs-body { font-size: 15px; line-height: 1.6; margin-top: 18px; }
  .cs-eyebrow { margin-bottom: 16px; }
  .cs-subhead { font-size: 14px; margin-top: 32px; margin-bottom: 12px; }

  /* Quote */
  .cs-quote { padding: 24px 20px; margin-top: 32px; font-size: 18px; }

  /* Before/After */
  .cs-ba-block { padding: 24px 20px; }

  /* Figure / image cards */
  .cs-figure { margin-top: 32px; }
  .cs-figure-caption { padding: 12px 16px; font-size: 11px; }

  /* CTA */
  .cs-cta { padding: 56px 20px; }
  .cs-cta-row { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cs-cta-title { font-size: clamp(26px, 7.5vw, 36px); }
  .cs-next { padding-top: 24px; margin-top: 32px; gap: 12px; }
  .cs-next-link { font-size: clamp(18px, 5vw, 22px); }

  /* Edge case showcase compacts */
  .cs-edge-showcase { margin-top: 32px; }
  .cs-edge-showcase-header { padding: 14px 18px; }
  .cs-edge-showcase-header-title { font-size: 13px; }
  .cs-edge-showcase-header-sub { font-size: 12px; }
  .cs-edge-showcase-footer { padding: 18px 18px 22px; }
}
