/* ════════════════════════════════════════════
   CASE STUDY DETAIL PAGE — case-study-detail.css
   Add this file to your <head> on case study pages only
════════════════════════════════════════════ */

/* ── HERO ── */
#cs-page-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8rem 1.5rem 4rem;
  overflow: hidden;
  background: #1E1E21;
}

#cs-page-hero #services-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.csp-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.csp-hero-inner h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0.75rem 0;
  background: linear-gradient(180deg, #fff 0%, #f1f1f4 40%, #c7caf5 75%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.csp-hero-sub {
  font-size: 0.95rem;
  color: #94a3b8;
  line-height: 1.65;
  max-width: 540px;
  margin: 0 auto 2rem;
}

/* Stats bar */
.csp-stats-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto;
}

.csp-stat {
  flex: 1;
  padding: 1.1rem 1rem;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.csp-stat:last-child { border-right: none; }

.csp-stat-num {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.csp-stat-label {
  display: block;
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.3;
}

/* ── SECTION BASE ── */
.csp-section {
  padding: 5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.csp-section--alt {
  background: #232328;
}

.csp-inner {
  max-width: 960px;
  margin: 0 auto;
}

.csp-inner--wide {
  max-width: 1100px;
}

/* Label + heading */
.csp-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #818cf8;
  margin-bottom: 0.6rem;
}

.csp-label-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.csp-label-row p {
  font-size: 0.82rem;
  color: #64748b;
}

.csp-section h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.65rem;
  letter-spacing: -0.01em;
}

.csp-section-lead {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.7;
  max-width: 620px;
  margin-bottom: 2.5rem;
}

/* ── VIDEO ── */
.csp-video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 18px;
  overflow: hidden;
  background: #232328;
  margin-top: 1.5rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    0 24px 48px rgba(0, 0, 0, 0.4);
}

.csp-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── OVERVIEW TWO-COL ── */
.csp-two-col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.csp-snapshot {
  background: #1a1a1d;
  border-radius: 14px;
  padding: 1.5rem;
  position: sticky;
  top: 6rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.csp-snapshot-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #475569;
  margin-bottom: 1rem;
}

.csp-snapshot-list {
  list-style: none;
}

.csp-snapshot-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
}

.csp-snapshot-list li:last-child { border-bottom: none; }

.csp-snapshot-list li span:first-child { color: #64748b; flex-shrink: 0; }
.csp-snapshot-list li span:last-child  { color: #e2e8f0; font-weight: 500; text-align: right; }

.csp-snap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.csp-snap-tags span {
  font-size: 0.68rem;
  color: #c4b5fd;
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid rgba(124, 92, 255, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.csp-overview-text p {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.75;
  margin-bottom: 1rem;
}

.csp-overview-text p:last-child { margin-bottom: 0; }

/* ── IMAGE SECTIONS ── */
.csp-img-section { padding: 3rem 1.5rem; }

.csp-img-grid {
  display: grid;
  gap: 1rem;
}

.csp-img-grid--3 {
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
}

.csp-img-card {
  border-radius: 14px;
  overflow: hidden;
  background: #232328;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.csp-img-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.csp-img-card--tall img { height: 280px; }

.csp-img-card:hover img { transform: scale(1.04); }

.csp-img-card figcaption {
  font-size: 0.72rem;
  color: #64748b;
  padding: 0.65rem 1rem;
  text-align: center;
}

/* ── PROBLEM GRID ── */
.csp-problem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.csp-problem-item {
  background: #232328;
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: box-shadow 0.25s ease;
}

.csp-problem-item:hover {
  box-shadow:
    inset 0 0 0 1px rgba(124, 92, 255, 0.28),
    0 8px 24px rgba(124, 92, 255, 0.1);
}

.csp-problem-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}

.csp-problem-item h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.csp-problem-item p {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}

/* ── APPROACH STEPS ── */
.csp-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 2rem;
  margin-top: 0.5rem;
}

.csp-step {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: start;
  position: relative;
}

.csp-step::before {
  content: '';
  position: absolute;
  left: -2.35rem;
  top: 2rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid #1a1a1d;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.csp-step:last-child { border-bottom: none; }

.csp-step-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.csp-step-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.csp-step-left h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.csp-step > p {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0;
  padding-top: 0.15rem;
}

/* ── CAROUSEL ── */
.csp-carousel {
  position: relative;
  margin-top: 1.5rem;
}

.csp-carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.csp-carousel-slide {
  min-width: calc(33.333% - 0.85rem);
  flex-shrink: 0;
  scroll-snap-align: start;
  border-radius: 14px;
  overflow: hidden;
  background: #232328;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  margin: 0;
}

.csp-carousel-slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.csp-carousel-slide figcaption {
  font-size: 0.72rem;
  color: #64748b;
  padding: 0.65rem 1rem;
  text-align: center;
}

.csp-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.csp-carousel-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #232328;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.csp-carousel-btn:hover {
  background: rgba(124, 92, 255, 0.15);
  border-color: rgba(124, 92, 255, 0.4);
  color: #c4b5fd;
}

.csp-carousel-dots {
  display: flex;
  gap: 0.4rem;
}

.csp-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.csp-carousel-dot.active {
  background: #818cf8;
  transform: scale(1.3);
}

/* ── RESULTS ── */
.csp-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.csp-result-card {
  background: #232328;
  border-radius: 16px;
  padding: 2rem 1.25rem;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.csp-result-card--accent {
  background: linear-gradient(160deg, #2d2440, #1c1825);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.3);
}

.csp-result-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.csp-result-label {
  font-size: 0.77rem;
  color: #94a3b8;
  line-height: 1.45;
}

/* ── TECH BADGES ── */
.csp-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.csp-tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #e2e8f0;
  background: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.55rem 1rem;
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.csp-tech-badge:hover {
  background: rgba(124, 92, 255, 0.08);
  border-color: rgba(124, 92, 255, 0.28);
}

.csp-tech-badge i { font-size: 1.1rem; }

/* ── RELATED ── */
.csp-related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.csp-related-card {
  background: #232328;
  border-radius: 16px;
  padding: 1.75rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: box-shadow 0.25s, transform 0.25s;
}

.csp-related-card:hover {
  box-shadow:
    inset 0 0 0 1px rgba(124, 92, 255, 0.35),
    0 12px 32px rgba(124, 92, 255, 0.14);
  transform: translateY(-3px);
}

.csp-related-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.csp-related-top i:last-child {
  color: #475569;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.csp-related-card:hover .csp-related-top i:last-child {
  color: #c4b5fd;
}

.csp-related-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin: 0;
}

.csp-related-card > p {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .csp-two-col {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .csp-snapshot {
    position: relative;
    top: 0;
  }

  .csp-img-grid--3 {
    grid-template-columns: 1fr 1fr;
  }

  .csp-results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .csp-carousel-slide {
    min-width: calc(50% - 0.65rem);
  }

  .csp-step {
    grid-template-columns: 120px 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 600px) {
  #cs-page-hero {
    min-height: 380px;
    padding: 7rem 1.25rem 3rem;
  }

  .csp-stats-bar {
    flex-wrap: wrap;
  }

  .csp-stat {
    flex: 1 1 45%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .csp-stat:nth-child(3),
  .csp-stat:nth-child(4) {
    border-bottom: none;
  }

  .csp-problem-grid {
    grid-template-columns: 1fr;
  }

  .csp-results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .csp-related-grid {
    grid-template-columns: 1fr;
  }

  .csp-img-grid--3 {
    grid-template-columns: 1fr;
  }

  .csp-img-card--tall img {
    height: 200px;
  }

  .csp-steps {
    padding-left: 1.25rem;
  }

  .csp-step {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .csp-step::before {
    left: -1.6rem;
  }

  .csp-carousel-slide {
    min-width: 85%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .csp-img-card img,
  .csp-related-card,
  .csp-problem-item {
    transition: none;
  }
}