/* ============================================
   CASE STUDY PAGE
============================================ */

/* ── Hero ──────────────────────────────────── */
.cs-hero {
  padding-top: 7rem;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(74, 144, 217, 0.1), transparent),
    radial-gradient(ellipse 40% 60% at 80% 70%, rgba(30, 58, 95, 0.2), transparent),
    var(--bg);
}

.cs-hero__top {
  padding-bottom: 3rem;
}

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
  transition: color 0.2s, gap 0.2s;
}

.cs-back:hover { color: var(--accent); gap: 0.75rem; }

.cs-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.cs-hero__client {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.cs-hero__title {
  font-family: 'Aloe', serif;
  font-size: clamp(3rem, 6vw, 6.5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 3rem;
}

.cs-hero__intro {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 72ch;
  margin-bottom: 3rem;
}

.cs-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.cs-stat {
  padding: 1.5rem 1.75rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--bg-surface);
  transition: background 0.25s;
}

.cs-stat:last-child { border-right: none; }
.cs-stat:hover { background: var(--bg-elevated); }

.cs-stat__num {
  font-family: 'Aloe', serif;
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
}

.cs-stat__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.cs-hero__image {
  margin-top: 4rem;
}

/* ── Hero meta bar ──────────────────────────── */
.cs-hero__meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.cs-hero__meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.5rem;
  border-right: 1px solid var(--border);
  flex: 1;
  min-width: 100px;
  background: var(--bg-surface);
}

.cs-hero__meta-item:last-child { border-right: none; }

.cs-hero__meta-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-hero__meta-value {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .cs-hero__meta { flex-direction: column; }
  .cs-hero__meta-item { border-right: none; border-bottom: 1px solid var(--border); }
  .cs-hero__meta-item:last-child { border-bottom: none; }
}

/* ── Image placeholders ─────────────────────── */
.cs-placeholder {
  background: linear-gradient(135deg, #0f2040 0%, #060d18 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-placeholder--hero {
  aspect-ratio: 16 / 5;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

.cs-placeholder--wide {
  aspect-ratio: 16 / 6;
}

.cs-placeholder--step {
  aspect-ratio: 4 / 3;
}

.cs-placeholder__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  opacity: 0.35;
}

.cs-placeholder__label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

.cs-placeholder__icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}

.cs-placeholder__icon svg {
  width: 100%;
  height: 100%;
}

/* ── Sections ───────────────────────────────── */
.cs-section {
  padding: var(--section-py) 0;
  background: var(--bg-alt);
}

.cs-section:nth-child(even) {
  background: var(--bg);
}

/* ── Overview ───────────────────────────────── */
.cs-overview {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
}

.cs-overview__body .section__heading {
  margin-bottom: 2rem;
}

.cs-body {
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 1.25rem;
  max-width: 70ch;
}

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

.cs-overview__sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6rem;
}

.cs-detail {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cs-detail:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cs-detail__label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cs-detail__value {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── Body grid (main + sidebar) ─────────────── */
.cs-body-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: clamp(3rem, 5vw, 5rem);
  align-items: start;
}

.cs-body-grid__main {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.cs-body-grid__side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6rem;
}

/* ── Content blocks ─────────────────────────── */
.cs-block { display: flex; flex-direction: column; gap: 1rem; }

.cs-block__heading {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

/* ── Image blocks ───────────────────────────── */
.cs-image-block { width: 100%; }

/* ── Sidebar cards ──────────────────────────── */
.cs-sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
}

/* ── Three systems ──────────────────────────── */
.cs-system {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.cs-system:last-child { border-bottom: none; padding-bottom: 0; }

.cs-system__title {
  font-family: 'Aloe', serif;
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.cs-system .cs-body {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* ── Callout box ────────────────────────────── */
.cs-callout {
  background: rgba(208, 255, 113, 0.04);
  border: 1px solid rgba(208, 255, 113, 0.15);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.75rem;
}

.cs-callout__heading {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.cs-callout .cs-body {
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.cs-callout .cs-body:last-child { margin-bottom: 0; }

/* ── Project details (sidebar) ──────────────── */
.cs-project-details {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Outcomes ───────────────────────────────── */
.cs-outcomes-section {
  background:
    radial-gradient(ellipse 55% 60% at 15% 40%, rgba(30, 58, 95, 0.25), transparent),
    radial-gradient(ellipse 40% 50% at 85% 70%, rgba(208, 255, 113, 0.04), transparent),
    var(--bg-alt);
}

.cs-outcomes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 3rem;
}

.cs-outcome {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--bg-surface);
  transition: background 0.25s;
}

.cs-outcome:nth-child(2n) { border-right: none; }
.cs-outcome:nth-child(n+3) { border-bottom: none; }
.cs-outcome:hover { background: var(--bg-elevated); }

.cs-outcome__num {
  font-family: 'Aloe', serif;
  font-size: clamp(2.5rem, 4vw, 4rem);
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
}

.cs-outcome__label {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 40ch;
}

/* ── Next case study ────────────────────────── */
.cs-next {
  padding: var(--section-py) 0;
  background: var(--bg);
  text-align: center;
}

.cs-next__label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.cs-next__title {
  font-family: 'Aloe', serif;
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.cs-next__desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 50ch;
  margin: 0 auto 2.5rem;
  line-height: 1.75;
}

/* ── Chapter navigation ─────────────────────── */
.cs-chapter-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: calc(var(--section-py) * 0.5);
}

.cs-chapter-nav__item {
  padding: 1.75rem 2rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  background: var(--bg-surface);
  transition: background 0.25s;
  cursor: pointer;
}

.cs-chapter-nav__item:last-child { border-right: none; }
.cs-chapter-nav__item:hover,
.cs-chapter-nav__item.active { background: var(--bg-elevated); }

.cs-chapter-nav__num {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.cs-chapter-nav__title {
  font-family: 'Aloe', serif;
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.2;
}

.cs-chapter-nav__status {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ── Chapter section ────────────────────────── */
.cs-chapter {
  padding: var(--section-py) 0;
  background: var(--bg-alt);
}

.cs-chapter:nth-of-type(even) { background: var(--bg); }

.cs-chapter-header {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}

.cs-chapter-num {
  font-family: 'Aloe', serif;
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 300;
  color: var(--accent);
  opacity: 0.25;
  line-height: 0.9;
  flex-shrink: 0;
  letter-spacing: -0.04em;
}

.cs-chapter-header__body { flex: 1; }

.cs-chapter-title {
  font-family: 'Aloe', serif;
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.cs-chapter-desc {
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 66ch;
}

/* ── Subsection divider label ───────────────── */
.cs-sublabel {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 3rem 0 1.75rem;
}

.cs-sublabel__text {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.cs-sublabel__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Desktop wireframe grid ─────────────────── */
.cs-wf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.cs-wf-grid__img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  background: var(--bg-surface);
  object-fit: cover;
}

/* ── Desktop image grid (3-col wrapping) ── */
.cs-scroll-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* The inner wrapper is a passthrough in grid mode */
.cs-scroll-strip__inner {
  display: contents;
}

.cs-scroll-strip__img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  object-fit: cover;
  background: var(--bg-surface);
}

/* ── Mobile image grid (6-col wrapping) ── */
.cs-phone-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  align-items: start;
}

.cs-phone-strip__img {
  width: 100%;
  height: 260px;
  border-radius: 16px;
  border: 1px solid var(--border);
  display: block;
  object-fit: contain;
  background: var(--bg-surface);
}

/* Placeholder chapter block */
.cs-chapter-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  opacity: 0.5;
}

.cs-chapter-placeholder p {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1100px) {
  .cs-chapter-header { gap: 1.5rem; }
}

@media (max-width: 900px) {
  .cs-chapter-nav { grid-template-columns: 1fr; }
  .cs-chapter-nav__item { border-right: none; border-bottom: 1px solid var(--border); }
  .cs-chapter-nav__item:last-child { border-bottom: none; }
  .cs-wf-grid { grid-template-columns: repeat(2, 1fr); }
  .cs-scroll-strip { grid-template-columns: repeat(2, 1fr); }
  .cs-phone-strip { grid-template-columns: repeat(3, 1fr); }
  .cs-chapter-header { flex-direction: column; gap: 0.5rem; }
  .cs-chapter-num { font-size: 3rem; }
}

@media (max-width: 600px) {
  .cs-wf-grid { grid-template-columns: 1fr; }
  .cs-scroll-strip { grid-template-columns: repeat(2, 1fr); }
  .cs-phone-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1100px) {
  .cs-body-grid { grid-template-columns: 1fr; }
  .cs-body-grid__side { position: static; }
  .cs-overview { grid-template-columns: 1fr; }
  .cs-overview__sidebar { position: static; }
}

@media (max-width: 768px) {
  .cs-hero__stats { grid-template-columns: 1fr; }
  .cs-stat { border-right: none; border-bottom: 1px solid var(--border); }
  .cs-stat:last-child { border-bottom: none; }
  .cs-outcomes { grid-template-columns: 1fr; }
  .cs-outcome { border-right: none; border-bottom: 1px solid var(--border); }
  .cs-outcome:last-child { border-bottom: none; }
}
