/* ============================================
   CASE STUDY — SHARED STYLES
   ============================================ */

/* ─── HERO ─── */
.cs-hero {
  padding: 140px 24px 100px;
  position: relative;
  overflow: hidden;
}
.cs-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.cs-eyebrow {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 36px;
}
.cs-hero-title {
  font-size: clamp(72px, 13vw, 160px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: #fff;
  margin: 0 0 36px;
}
.cs-hero-title span {
  display: block;
}
.cs-hero-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}
.cs-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.69; transform: scale(1); }
  50%       { opacity: 0.38; transform: scale(0.85); }
}
.cs-hero-sub {
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}
.cs-hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.cs-hero-meta span::after {
  content: '·';
  margin-left: 20px;
  opacity: 0.35;
}
.cs-hero-meta span:last-child::after { display: none; }

/* ─── FIXED SIDE NAV ─── */
.cs-side-nav {
  position: fixed;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: flex-end;
}
.cs-side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}
.cs-side-nav-label {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  transition: color 0.25s;
  white-space: nowrap;
}
.cs-side-nav-line {
  width: 10px;
  height: 1px;
  background: rgba(255,255,255,0.18);
  transition: width 0.25s ease, background 0.25s;
}
.cs-side-nav a.active .cs-side-nav-label { color: var(--accent); }
.cs-side-nav a.active .cs-side-nav-line  { width: 28px; background: var(--accent); }
.cs-side-nav a:hover .cs-side-nav-label  { color: #fff; }

/* ─── SECTION STRUCTURE ─── */
.cs-section {
  position: relative;
  padding: 100px 24px;
}
/* Top rule — matches Figma frame (accent gradient, ~40% opacity) */
.cs-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  opacity: 0.4;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(206, 255, 60, 0.18) 35%,
    rgba(255, 95, 56, 0.12) 65%,
    transparent 100%
  );
  pointer-events: none;
}
.cs-section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── SECTION HEADER ─── */
.cs-section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 72px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cs-section-num {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.cs-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

/* ─── OPENING STATEMENT ─── */
.cs-opening {
  max-width: 900px;
  margin: 0 auto 72px;
}
.cs-opening-headline {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.148;
  max-width: 900px;
  color: #fff;
  margin-bottom: 16px;
}
.cs-opening-sub {
  font-size: 20px;
  color: rgba(255,255,255,0.7);
}

/* ─── STATS GRID ─── */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto 72px;
}
.cs-stat {
  background: var(--bg);
  padding: 32px 28px;
}
.cs-stat-label {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
}
.cs-stat-value {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

/* ─── BODY COPY ─── */
.cs-body {
  max-width: 680px;
  margin: 0 auto;
}
.cs-body p {
  font-size: 17px;
  line-height: 1.78;
  color: rgba(255,255,255,0.7);
  margin-bottom: 28px;
}
.cs-body p:last-child { margin-bottom: 0; }
.cs-body-list {
  max-width: 680px;
  margin: 0 auto 28px;
  padding-left: 20px;
  list-style: disc;
}
.cs-body-list li {
  font-size: 17px;
  line-height: 1.78;
  color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
  padding-left: 6px;
}
.cs-body-list li:last-child { margin-bottom: 0; }

/* ─── PULL QUOTE ─── */
.cs-quote {
  max-width: 860px;
  margin: 72px auto;
  padding: 0 0 0 32px;
  border-left: 3px solid var(--accent);
}
.cs-quote blockquote {
  font-size: clamp(20px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  max-width: 825px;
  color: #fff;
  margin-bottom: 16px;
}
.cs-quote cite {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  font-style: normal;
}

/* ─── IMAGE: FULL WIDTH ─── */
.cs-img-full {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 48px 0;
}
.cs-img-caption {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.7);
  text-align: center;
  margin-top: 16px;
  margin-bottom: 48px;
}

/* ─── IMAGE: 2-UP GRID ─── */
.cs-img-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 16px;
  margin: 48px 0;
}
.cs-img-grid-2 img { width: 100%; height: auto; display: block; align-self: start; border-radius: 8px; }
.cs-img-grid-2.uniform img { height: 480px; object-fit: cover; object-position: top; align-self: stretch; }

/* ─── IMAGE: 3-UP GRID ─── */
.cs-img-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: start;
  gap: 16px;
  margin: 48px 0;
}
.cs-img-grid-3 img { width: 100%; height: auto; display: block; align-self: start; border-radius: 8px; }

/* ─── IMAGE PLACEHOLDER ─── */
.cs-img-ph {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--s2);
  border-radius: 8px;
  border: 1px dashed rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 48px 0;
}
.cs-img-ph span {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* ─── BEFORE → AFTER SHIFT ─── */
.cs-shift {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(206,255,60,0.02));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 28px 32px;
  margin: 48px 0;
}
.cs-shift-side { }
.cs-shift-label {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 8px;
}
.cs-shift-before .cs-shift-value { color: rgba(255,255,255,0.7); font-size: 15px; }
.cs-shift-after  .cs-shift-label { color: var(--accent); }
.cs-shift-after  .cs-shift-value { color: #fff; font-size: 15px; font-weight: 500; }
.cs-shift-arrow {
  text-align: center;
  font-size: 20px;
  color: var(--accent);
}

/* ─── TIMELINE / ITERATIONS ─── */
.cs-timeline {
  position: relative;
  padding-left: 48px;
}
.cs-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255,255,255,0.07);
}
.cs-iter {
  position: relative;
  margin-bottom: 80px;
}
.cs-iter:last-child { margin-bottom: 0; }
.cs-iter-header {
  position: relative;
  margin-bottom: 6px;
}
.cs-iter-dot {
  position: absolute;
  left: -48px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 5px;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 40%, transparent);
}
.cs-iter-index {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0;
}
.cs-iter-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.cs-iter-body {
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  margin-bottom: 28px;
  max-width: 680px;
}

/* ─── OUTCOME CARDS ─── */
.cs-outcomes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  overflow: hidden;
  max-width: 1100px;
  margin: 0 auto 72px;
}
.cs-outcome-card {
  background: var(--bg);
  padding: 36px 32px;
}
.cs-outcome-num {
  font-family: var(--body);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.cs-outcome-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.cs-outcome-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
}

/* ─── FINAL IMAGE CONTAINER ─── */
.cs-final-img {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
  overflow: hidden;
}
.cs-final-img img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

/* ─── CLOSING STATEMENT ─── */
.cs-close-statement {
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fff;
  max-width: 680px;
  margin: 48px auto;
}
.cs-footnote {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  font-style: italic;
  max-width: 680px;
  margin: 0 auto 48px;
}

/* ─── BACK LINK ─── */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s;
  margin-bottom: 60px;
}
.cs-back:hover { color: var(--accent); }

/* ─── GALLERY ITEMS (case study overrides) ─────────────────────────────────
   styles.css sets .gallery-item { aspect-ratio: 4/3; overflow: hidden } for
   the portfolio grid. Here every gallery-item IS an <img>, so we reset to
   intrinsic dimensions. Never force a fixed ratio — let the image dictate its
   own height from its real pixel dimensions.
   ───────────────────────────────────────────────────────────────────────── */
.cs-section .gallery-item,
.cs-final-img .gallery-item {
  aspect-ratio: auto;   /* cancel the 4/3 lock from styles.css */
  overflow: visible;    /* cancel overflow:hidden from styles.css */
  background: none;
  position: static;
  display: block;
  width: 100%;
  height: auto;         /* height always derived from intrinsic pixel ratio */
  align-self: start;    /* prevent CSS Grid row from stretching the cell */
  cursor: zoom-in;
}

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.93);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  transition: opacity 0.18s ease;
  user-select: none;
}
.lightbox__img.transitioning {
  opacity: 0;
}
.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.lightbox__close {
  top: 24px;
  right: 24px;
}
.lightbox__prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__meta {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--body);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox__counter {
  color: var(--accent);
  flex-shrink: 0;
}
.lightbox__caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .cs-hero { padding: 100px 16px 72px; }
  .cs-side-nav { display: none; }
  .cs-section { padding: 72px 16px; }
  .cs-section::before {
    left: 16px;
    right: 16px;
  }
  .cs-stats { grid-template-columns: 1fr 1fr; }
  .cs-stats .cs-stat:last-child { grid-column: 1 / -1; }
  .cs-outcomes { grid-template-columns: 1fr; }
  .cs-img-grid-3 { grid-template-columns: 1fr 1fr; }
  .cs-img-grid-3 img:last-child { grid-column: 1 / -1; }
  .cs-shift { grid-template-columns: 1fr; }
  .cs-shift-arrow { display: none; }
  .cs-timeline { padding-left: 32px; }
  .cs-iter-dot { left: -32px; }
}
@media (max-width: 600px) {
  .cs-hero-title { line-height: 0.92; }
  .cs-stats { grid-template-columns: 1fr; }
  .cs-img-grid-2 { grid-template-columns: 1fr; }
  .cs-img-grid-3 { grid-template-columns: 1fr; }
  .cs-img-grid-3 img:last-child { grid-column: auto; }
  .cs-outcomes { grid-template-columns: 1fr; }
}
