/* ════════════════════════════════
   CASE STUDY — matches CaseStudy.tsx
════════════════════════════════ */

/* ── HERO (dark section) ── */
.cs-hero { background: var(--dark); padding: clamp(6rem,9vw,12rem) 0; }
.cs-hero-inner { display: flex; flex-direction: column; gap: 2.4rem; }
.cs-back {
  display: inline-block; font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--white); text-decoration: none; align-self: flex-start;
  transition: opacity 0.15s;
}
.cs-back:hover { opacity: 0.7; }
.cs-cat {
  font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--white);
}
.cs-title {
  font-size: clamp(4rem,9vw,12rem);
  font-weight: 700; letter-spacing: -0.04em;
  color: var(--white); line-height: 1;
}
.cs-subtitle {
  font-style: italic; font-family: var(--font-serif);
  font-size: clamp(1.8rem,2.4vw,2.8rem); color: var(--white); font-weight: 400;
}
.cs-meta-pills { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.cs-meta-pill {
  font-size: 1.4rem; padding: 0.6rem 1.6rem; border-radius: 999px;
  border: 1px solid var(--white); color: var(--white); background: transparent;
}
.cs-banner {
  aspect-ratio: 21/9; border-radius: 1.6rem;
  overflow: hidden; background: #000; margin-top: 3.2rem; position: relative;
}
.cs-banner img,
.cs-banner video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── BODY (light section) ── */
.cs-body { background: var(--light); padding: clamp(6rem,9vw,12rem) 0; }
.cs-body-inner { display: flex; flex-direction: column; gap: 9.6rem; }

/* ── BLOCK pattern ── */
.cs-block {
  border-top: 1px solid var(--border-light);
  padding-top: 3rem;
  display: flex; flex-direction: column; gap: 2rem;
}
.cs-block-label {
  font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--dark);
}
.cs-block-title {
  font-size: clamp(2.4rem,3vw,3.6rem); font-weight: 700;
  letter-spacing: -0.02em; color: var(--dark); line-height: 1.2;
}

/* ── METRIC CARDS (At a Glance) ── */
.cs-metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.6rem; }
.cs-metric-card {
  background: var(--dark); color: var(--white);
  border-radius: 1.6rem; padding: 2.4rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.cs-metric-val { font-size: clamp(3.2rem,5vw,6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.cs-metric-label { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--white); }
.cs-metric-sub { font-size: 1.4rem; color: var(--white); }
@media (max-width: 600px) { .cs-metric-grid { grid-template-columns: 1fr 1fr; } }

/* ── OVERVIEW 2-col ── */
.cs-overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.cs-overview-text { font-size: 1.8rem; line-height: 1.7; color: var(--dark); }
.cs-overview-img { aspect-ratio: 4/3; border-radius: 1.6rem; overflow: hidden; background: #000; }
.cs-overview-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 767px) { .cs-overview-grid { grid-template-columns: 1fr; } }

/* ── PROBLEM ── */
.cs-problem-text { font-size: 1.8rem; line-height: 1.7; color: var(--dark); max-width: 72rem; }
.cs-blockquote {
  border-left: 3px solid var(--dark); padding-left: 2.4rem;
  margin-top: 2.4rem; font-size: 2rem; color: var(--dark);
  font-style: italic; font-family: var(--font-serif); line-height: 1.6;
}

/* ── PROCESS steps (horizontal on desktop) ── */
.cs-process { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0; margin-top: 1.6rem; }
.cs-process-item { display: flex; align-items: flex-start; flex: 1; min-width: 12rem; }
.cs-process-step { display: flex; flex-direction: column; gap: 1.2rem; flex: 1; }
.cs-process-node {
  width: 4rem; height: 4rem; border-radius: 50%;
  background: var(--dark); color: var(--white);
  font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cs-process-label { font-size: 1.5rem; font-weight: 600; color: var(--dark); line-height: 1.3; }
.cs-process-desc { font-size: 1.3rem; color: var(--dark); line-height: 1.5; }
.cs-process-arrow {
  display: flex; align-items: flex-start;
  padding-top: 1.2rem; width: 2.4rem; justify-content: center;
  color: var(--dark); font-size: 1.6rem; flex-shrink: 0;
}
@media (max-width: 767px) {
  .cs-process { flex-direction: column; gap: 0; }
  .cs-process-item { flex: none; width: 100%; }
  .cs-process-arrow { transform: rotate(90deg); padding: 0.4rem 0 0.4rem 0; justify-content: flex-start; padding-left: 0.8rem; }
}

/* ── ARCH DIAGRAM ── */
.cs-arch { background: var(--dark); border-radius: 1.6rem; padding: 3.2rem; margin-top: 0.8rem; }
.cs-arch-row { display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: center; margin-bottom: 1.6rem; }
.cs-arch-row:last-child { margin-bottom: 0; }
.cs-arch-node {
  border: 1px solid var(--white); border-radius: 1.2rem;
  padding: 1.2rem 1.6rem; text-align: center; color: var(--white); min-width: 9rem;
}
.cs-arch-node.highlight {
  border-color: var(--white); border-width: 1.5px;
  background: rgba(255,255,255,0.08);
}
.cs-arch-node-label { font-size: 1.4rem; font-weight: 600; }
.cs-arch-node-sub { font-size: 1.1rem; color: var(--white); margin-top: 0.2rem; }
.cs-arch-arrow { font-size: 1.6rem; font-weight: 700; color: var(--white); flex-shrink: 0; }
.cs-arch-group { display: flex; flex-direction: column; gap: 0.8rem; }
.cs-arch-group-label { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; text-align: center; color: var(--white); margin-bottom: 0.4rem; }
.cs-arch-sep { width: 100%; height: 1px; background: rgba(255,255,255,0.08); }

/* ── SOLUTION ── */
.cs-solution-text { font-size: 1.8rem; line-height: 1.7; color: var(--dark); max-width: 72rem; }
.cs-solution-img { aspect-ratio: 21/9; border-radius: 1.6rem; overflow: hidden; background: #000; margin-top: 3.2rem; }
.cs-solution-img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── TECH TABLE ── */
.cs-tech-wrap { overflow-x: auto; margin-top: 0.8rem; }
.cs-tech-table { width: 100%; border-collapse: collapse; font-size: 1.5rem; }
.cs-tech-table thead tr { background: var(--dark); color: var(--white); }
.cs-tech-table thead th { text-align: left; padding: 1.6rem 2rem; font-weight: 600; }
.cs-tech-table thead th:first-child { border-radius: 1.2rem 0 0 0; }
.cs-tech-table thead th:last-child { border-radius: 0 1.2rem 0 0; }
.cs-tech-table tbody tr { border-bottom: 1px solid var(--border-light); background: var(--white); }
.cs-tech-table tbody tr:nth-child(even) { background: rgba(26,26,26,0.03); }
.cs-tech-table tbody td { padding: 1.6rem 2rem; color: var(--dark); vertical-align: top; line-height: 1.5; }
.cs-tech-table tbody td:first-child { font-weight: 600; }

/* ── METRIC BARS (Performance) ── */
.cs-metric-bars { display: flex; flex-direction: column; gap: 2.4rem; margin-top: 0.8rem; }
.cs-mbar { display: flex; flex-direction: column; gap: 0.8rem; }
.cs-mbar-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.6rem; }
.cs-mbar-info { display: flex; flex-direction: column; gap: 0.2rem; }
.cs-mbar-label { font-size: 1.5rem; font-weight: 600; color: var(--dark); }
.cs-mbar-sub { font-size: 1.3rem; color: var(--dark); }
.cs-mbar-val { font-size: 1.6rem; font-weight: 700; color: var(--dark); flex-shrink: 0; }
.cs-mbar-track { height: 0.8rem; background: rgba(26,26,26,0.1); border-radius: 999px; overflow: hidden; }
.cs-mbar-fill { height: 100%; background: var(--dark); border-radius: 999px; width: 0; transition: width 1s ease; }
.cs-mbar-fill.animated { /* width set by JS from data-bar-width */ }

/* ── DELIVERABLES (Electrofuel) ── */
.cs-deliverables-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.6rem; }
.cs-deliverable-card {
  border: 2px solid var(--border-light); background: var(--white);
  border-radius: 1.2rem; padding: 2rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.cs-deliverable-val { font-size: clamp(2rem,3vw,3.2rem); font-weight: 700; color: var(--dark); letter-spacing: -0.02em; }
.cs-deliverable-label { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dark); }
.cs-deliverable-sub { font-size: 1.4rem; color: var(--dark); }
@media (max-width: 600px) { .cs-deliverables-grid { grid-template-columns: 1fr 1fr; } }

/* ── OUTCOMES ── */
.cs-outcomes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 0.8rem; }
.cs-outcome-item { display: flex; gap: 1.6rem; align-items: flex-start; }
.cs-outcome-check {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--dark); color: var(--white);
  font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 0.2rem;
}
.cs-outcome-text { font-size: 1.6rem; color: var(--dark); line-height: 1.6; }
@media (max-width: 600px) { .cs-outcomes-grid { grid-template-columns: 1fr; } }

/* ── STACK CHIPS ── */
.cs-stack { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 0.8rem; }
.cs-stack-chip {
  font-size: 1.4rem; font-weight: 500;
  padding: 0.8rem 1.6rem; border-radius: 999px;
  border: 1px solid var(--border-light); color: var(--dark); background: var(--white);
}

/* ── GALLERY ── */
.cs-gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; margin-top: 1.6rem; }
.cs-gallery-grid.last-odd > *:last-child { grid-column: span 2; }
.cs-gallery-figure { display: flex; flex-direction: column; gap: 1.2rem; }
.cs-gallery-img { aspect-ratio: 4/3; width: 100%; border-radius: 1.2rem; object-fit: contain; background: #000; display: block; }
.cs-gallery-caption { font-size: 1.3rem; color: var(--dark); }
@media (max-width: 600px) {
  .cs-gallery-grid { grid-template-columns: 1fr; }
  .cs-gallery-grid.last-odd > *:last-child { grid-column: auto; }
}

/* ── DEVICE MOCKUPS (Web App gallery) ── */
.cs-device-showcase { display: flex; flex-direction: column; gap: 2.4rem; align-items: flex-end; margin-top: 2.4rem; }
@media (min-width: 600px) { .cs-device-showcase { flex-direction: row; align-items: flex-end; } }
.cs-device-tablet-wrap { flex: 1.8; }
.cs-device-phone-wrap { flex: 1; max-width: 22rem; width: 100%; }
.cs-tablet {
  background: #1c1c1e; border-radius: 1.6rem; padding: 1rem 1.2rem;
  box-shadow: 0 0 0 1.5px #3a3a3c, 0 24px 60px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; gap: 0.7rem;
}
.cs-tablet-camera { width: 0.75rem; height: 0.75rem; background: #3a3a3c; border-radius: 50%; margin: 0 auto; }
.cs-tablet-screen { background: #000; border-radius: 0.6rem; overflow: hidden; aspect-ratio: 4/3; }
.cs-tablet-screen img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cs-tablet-bar { width: 22%; height: 0.4rem; background: #3a3a3c; border-radius: 0.2rem; margin: 0 auto; }
.cs-phone {
  background: #1c1c1e; border-radius: 3rem; padding: 1rem;
  box-shadow: 0 0 0 1.5px #3a3a3c, 0 0 0 3px #1c1c1e, 0 0 0 4.5px #3a3a3c, 0 30px 80px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
}
.cs-phone-notch { width: 32%; height: 2.2rem; background: #000; border-radius: 1.5rem; flex-shrink: 0; }
.cs-phone-screen { background: #000; border-radius: 1.4rem; overflow: hidden; width: 100%; aspect-ratio: 9/19.5; }
.cs-phone-screen img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cs-phone-bar { width: 38%; height: 0.4rem; background: #3a3a3c; border-radius: 0.2rem; flex-shrink: 0; }

/* ── IMPACT (3-col dark cards) ── */
.cs-impact-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.6rem; margin-top: 0.8rem; }
.cs-impact-card {
  background: var(--dark); color: var(--white);
  border-radius: 1.6rem; padding: 2.4rem;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.cs-impact-label { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--white); }
.cs-impact-points { display: flex; flex-direction: column; gap: 1.2rem; list-style: none; padding: 0; margin: 0; }
.cs-impact-point { display: flex; gap: 1.2rem; align-items: flex-start; }
.cs-impact-bullet { color: var(--white); font-size: 1rem; margin-top: 0.3rem; flex-shrink: 0; }
.cs-impact-text { font-size: 1.4rem; color: var(--white); line-height: 1.6; }
@media (max-width: 767px) { .cs-impact-grid { grid-template-columns: 1fr; } }

/* ── CONCLUSION blockquote ── */
.cs-conclusion { border-left: 3px solid var(--dark); padding-left: 3.2rem; }
.cs-conclusion p {
  font-size: clamp(1.8rem,2vw,2.4rem); color: var(--dark);
  line-height: 1.7; font-style: italic; font-family: var(--font-serif);
}

/* ── ORG CHART (Electrofuel) ── */
.cs-org { display: flex; flex-direction: column; align-items: center; gap: 2.4rem; margin-top: 1.6rem; }
.cs-org-top { background: var(--dark); color: var(--white); font-size: 1.6rem; font-weight: 700; padding: 1.6rem 3.2rem; border-radius: 1.2rem; text-align: center; }
.cs-org-line { width: 1px; height: 3.2rem; background: var(--border-light); }
.cs-org-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6rem; }
.cs-org-dept { font-size: 1.4rem; font-weight: 600; padding: 1.2rem 2.4rem; border-radius: 1.2rem; border: 1px solid var(--border-light); background: var(--white); color: var(--dark); text-align: center; }

/* ── NEXT PROJECT ── */
.cs-next { background: var(--dark); padding: clamp(6rem,9vw,12rem) 0; }
.cs-next-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.6rem; }
.cs-next-label { font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--white); }
.cs-next-title { font-size: clamp(3rem,5vw,7rem); font-weight: 700; letter-spacing: -0.03em; color: var(--white); line-height: 1; }
.cs-next-subtitle { font-size: clamp(1.6rem,2vw,2.2rem); font-style: italic; font-family: var(--font-serif); color: var(--white); font-weight: 400; }
.cs-next-btn {
  background: var(--white); color: var(--dark);
  font-size: 1.6rem; font-weight: 600;
  padding: 1.6rem 3.2rem; border-radius: 999px;
  text-decoration: none; display: inline-block; margin-top: 0.8rem;
  transition: background-color 0.2s;
}
.cs-next-btn:hover { background: #d0cec9; }

/* Lightbox */
#lightbox {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.92); align-items: center; justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 0.8rem; }
#lightbox-close {
  position: absolute; top: 2rem; right: 2rem;
  background: none; border: none; color: var(--white);
  font-size: 3rem; cursor: pointer; line-height: 1;
}
