/* ============================================================
   Case Study — IG Investments
   Inherits tokens and fonts from custom.css
   ============================================================ */

/* ── PAGE ─────────────────────────────────────────────────── */
.cs-page {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden; /* prevent images wider than viewport from scrolling */
}

.cs-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 64px);
}

/* Reading column — left-aligned editorial */
.cs-col { max-width: 800px; }

/* ── BACK LINK ────────────────────────────────────────────── */
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted) !important;
  letter-spacing: 0.01em;
  transition: color 0.12s;
  margin-bottom: 56px;
}
.cs-back:hover { color: var(--text) !important; }

/* ── HERO ─────────────────────────────────────────────────── */
.cs-hero { padding: 64px 0 52px; }

.cs-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.cs-title {
  font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 5.5vw, 72px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 0 0 20px;
}

.cs-subtitle {
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 780px;
  margin: 0 0 52px;
  font-weight: 400;
}

/* Vertical meta — not tabular */
.cs-meta {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-meta-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs-meta-value {
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
}

.cs-disclaimer {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  font-style: italic;
  border-left: 2px solid var(--border);
  padding-left: 16px;
  margin: 24px 0 0;
  max-width: 600px;
}

/* ── HERO VISUAL ──────────────────────────────────────────── */
.cs-hero-visual { padding: 0 0 96px; }

.cs-hero-placeholder {
  width: 100%;
  aspect-ratio: 16 / 8;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Subtle inner depth */
.cs-hero-placeholder::before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 10px;
  border: 1px solid rgba(31, 31, 31, 0.06);
}

.cs-placeholder-caption {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-align: center;
  margin-top: 14px;
  font-style: italic;
}

.cs-placeholder-caption--below {
  text-align: left;
  margin-top: 14px;
}

/* ── SECTION CHROME ───────────────────────────────────────── */
.cs-body-wrap { padding-bottom: 0; }

.cs-section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.cs-section--last {
  border-bottom: 1px solid var(--border);
}

.cs-num {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.cs-heading {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 36px;
}

/* ── BODY COPY ────────────────────────────────────────────── */
.cs-prose p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text);
  margin: 0 0 22px;
}
.cs-prose p:last-child { margin-bottom: 0; }

/* ── SCOPE LIST ───────────────────────────────────────────── */
.cs-list {
  list-style: none;
  margin: 32px 0;
  padding: 0;
}

.cs-list li {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}
.cs-list li:first-child { border-top: 1px solid var(--border); }

.cs-list li::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  background: var(--muted);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── AUDIENCE COMPARISON ───────────────────────────────────── */
.cs-audience-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 52px auto 0;
  max-width: 960px;
}

.cs-audience-col {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 40px;
  background: var(--bg);
}

.cs-audience-heading {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.cs-audience-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs-audience-list li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.cs-audience-list li:last-child { border-bottom: none; }

.cs-audience-caption {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin: 14px auto 0;
  max-width: 960px;
  text-align: center;
}

@media (max-width: 600px) {
  .cs-audience-cols { grid-template-columns: 1fr; }
  .cs-audience-col { padding: 28px 24px; }
}

/* ── CONSTRAINTS ──────────────────────────────────────────── */
.cs-constraint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  max-width: 960px;
}

@media (max-width: 700px) {
  .cs-constraint-grid { grid-template-columns: 1fr; }
}

.cs-constraint {
  padding: 36px 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

/* Full-width constraint card */
.cs-constraint--wide {
  grid-column: 1 / 3;
}

@media (max-width: 700px) {
  .cs-constraint--wide { grid-column: 1; }
}

.cs-constraint-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.cs-constraint-body {
  font-size: 15px;
  line-height: 1.82;
  color: var(--text);
  margin: 0;
}

/* ── RESEARCH ARTIFACTS — ASYMMETRIC GRID ─────────────────── */
.cs-artifact-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 300px 260px 180px;
  gap: 12px;
  margin-top: 52px;
  max-width: 960px;
}

/* Research process flow — explicit placements */
.cs-artifact--questions { grid-column: 1 / 3; grid-row: 1; }
.cs-artifact--notes     { grid-column: 3;     grid-row: 1 / 3; }
.cs-artifact--affinity  { grid-column: 1;     grid-row: 2; }
.cs-artifact--prototype { grid-column: 2;     grid-row: 2; }
.cs-artifact--usability { grid-column: 1 / 3; grid-row: 3; }
/* col 3 row 3 intentionally empty — breathing room */

.cs-artifact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.cs-artifact-visual {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

/* Simulated document content lines */
.cs-artifact-visual::before {
  content: '';
  position: absolute;
  inset: 18px 22px;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 11px,
    rgba(0, 0, 0, 0.065) 11px,
    rgba(0, 0, 0, 0.065) 12px
  );
}

/* Blur veil over content simulation */
.cs-artifact-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(240, 237, 232, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cs-artifact-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .cs-artifact-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .cs-artifact--questions { grid-column: 1 / 3; grid-row: auto; }
  .cs-artifact--questions .cs-artifact-visual { aspect-ratio: 3/2; }
  .cs-artifact--notes { grid-column: auto; grid-row: auto; }
  .cs-artifact--notes .cs-artifact-visual { aspect-ratio: 3/4; }
  .cs-artifact--affinity  { grid-column: auto; grid-row: auto; }
  .cs-artifact--prototype { grid-column: auto; grid-row: auto; }
  .cs-artifact--usability { grid-column: 1 / 3; grid-row: auto; }
  .cs-artifact-visual { aspect-ratio: 3/4; }
}

/* ── DECISIONS ────────────────────────────────────────────── */
.cs-decisions {
  margin-top: 12px;
  max-width: 960px;
}

.cs-decision {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 48px;
  padding: 52px 0;
  border-top: 1px solid var(--border);
  align-items: start;
}
.cs-decision:last-child { border-bottom: 1px solid var(--border); }

/* Large editorial number */
.cs-decision-num {
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 200;
  color: var(--border);
  letter-spacing: -0.05em;
  line-height: 1;
  padding-top: 6px;
}

.cs-decision-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}

.cs-decision-desc {
  font-size: 15px;
  line-height: 1.88;
  color: var(--muted);
  margin: 0;
}

/* ── FINAL PRODUCT ────────────────────────────────────────── */
.cs-final-placeholder {
  margin-top: 48px;
  width: 100%;
  aspect-ratio: 16 / 8;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.cs-final-placeholder::before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 10px;
  border: 1px solid rgba(31, 31, 31, 0.06);
}

/* ── PUBLIC LAUNCH COMPOSITION ────────────────────────────── */
.cs-launch-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 400px 220px;
  gap: 12px;
  margin-top: 48px;
  max-width: 960px;
}

.cs-launch-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.cs-launch-item::before {
  content: '';
  position: absolute;
  inset: 20px;
  border-radius: 8px;
  border: 1px solid rgba(31, 31, 31, 0.06);
}

.cs-launch-label {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.cs-launch-item--primary { grid-column: 1; grid-row: 1 / 3; }
.cs-launch-item--reel    { grid-column: 2; grid-row: 1; }
.cs-launch-item--support { grid-column: 2; grid-row: 2; }

@media (max-width: 700px) {
  .cs-launch-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 280px 180px;
  }
  .cs-launch-item--primary { grid-column: 1 / 3; grid-row: 1; }
  .cs-launch-item--reel    { grid-column: 1;     grid-row: 2; }
  .cs-launch-item--support { grid-column: 2;     grid-row: 2; }
}

/* ── DESIGN SYSTEM GALLERY — ASYMMETRIC ───────────────────── */
.cs-gallery {
  display: grid;
  grid-template-columns: 5fr 3fr;
  grid-template-rows: 300px 200px 100px;
  gap: 12px;
  margin-top: 52px;
  max-width: 960px;
}

.cs-gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

/* Subtle inner surface */
.cs-gallery-item::before {
  content: '';
  position: absolute;
  inset: 16px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.03);
}

.cs-gallery-label {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  z-index: 1;
}

/* Grid placements — asymmetric editorial composition */
.cs-gallery-item--main  { grid-column: 1; grid-row: 1 / 3; } /* tall left */
.cs-gallery-item--token { grid-column: 2; grid-row: 1;     } /* right top */
.cs-gallery-item--doc   { grid-column: 2; grid-row: 2;     } /* right mid */
.cs-gallery-item--strip { grid-column: 1 / 3; grid-row: 3; } /* full-width strip */

@media (max-width: 700px) {
  .cs-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 160px 80px;
  }
  .cs-gallery-item--main  { grid-column: 1 / 3; grid-row: 1; }
  .cs-gallery-item--token { grid-column: 1;     grid-row: 2; }
  .cs-gallery-item--doc   { grid-column: 2;     grid-row: 2; }
  .cs-gallery-item--strip { grid-column: 1 / 3; grid-row: 3; }
}

/* ── REFLECTION ───────────────────────────────────────────── */
.cs-heading--reflection {
  font-size: clamp(28px, 3.2vw, 40px);
  margin-bottom: 36px;
}

.cs-reflection-text {
  font-size: 21px;
  line-height: 1.72;
  color: var(--text);
  font-weight: 400;
  max-width: 740px;
  margin: 0 0 28px;
  letter-spacing: -0.01em;
}

.cs-reflection-body {
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 700px;
  margin: 0 0 18px;
}
.cs-reflection-body:last-child { margin-bottom: 0; }

.cs-reflection-body em {
  font-style: italic;
  color: var(--text);
}

/* ── BOTTOM NAV ───────────────────────────────────────────── */
.cs-bottom-nav { padding: 52px 0 72px; }

.cs-bottom-nav .cs-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cs-back--bottom { margin-bottom: 0; }

.cs-copyright {
  font-size: 12px;
  color: var(--muted);
}

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 860px) {
  .cs-section { padding: 72px 0; }

  .cs-decision {
    grid-template-columns: 56px 1fr;
    gap: 24px;
  }

  .cs-decision-num {
    font-size: clamp(36px, 4vw, 56px);
  }
}

@media (max-width: 480px) {
  .cs-title { font-size: 44px; }
  .cs-subtitle { font-size: 17px; }

  .cs-decision { grid-template-columns: 1fr; gap: 8px; }
  .cs-decision-num { font-size: 32px; }
}

/* ── HERO IMAGE ───────────────────────────────────────────── */

.cs-hero-visual {
  padding: 0 0 96px;
}

/* Frame styled like the gallery item placeholders */
.cs-img-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.cs-img-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── SECTION IMAGES ───────────────────────────────────────── */

/* Narrow — portrait screenshots (france onboarding, reel) */
.cs-img-frame--sm { max-width: 420px; }

/* Wide — showcase visuals (affinity mapping, final product) */
.cs-img-frame--lg { max-width: 1040px; }

/* Spacing wrapper — consistent rhythm before each section image */
.cs-img-wrap {
  margin-top: 48px;
  width: 100%;
}

/* Stacked images share a tighter gap between them */
.cs-img-wrap + .cs-img-wrap { margin-top: 32px; }

/* Caption below image */
.cs-img-caption {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.02em;
  text-align: center;
  margin-top: 12px;
}

/* Plain text link for external launch content */
.cs-img-link {
  display: block;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  margin-top: 12px;
  transition: color 0.12s;
}
.cs-img-link:hover { color: var(--text); }

/* ── CASE IMAGE SYSTEM ────────────────────────────────────── */

/* Image — same visual as the original placeholders: rounded, bordered, light bg */
.case-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Card wrapper — semantic only, no visual weight */
.case-image-card {
  display: block;
}

.case-image-card figcaption {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  font-style: italic;
  letter-spacing: 0.01em;
  text-align: center;
}

/* Spacing above each image block */
.case-visual-section {
  margin-top: 52px;
}

/* Size helpers — keep images proportional to the 800px reading column */
.case-image-large {
  max-width: 840px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.case-image-medium {
  max-width: 680px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.case-image-small {
  max-width: 320px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Stacked image group */
.case-visual-stack {
  margin-top: 52px;
}

.case-visual-stack > * + * {
  margin-top: 28px;
}

/* Launch: portrait reel narrow, landscape campaign wider, side by side */
.case-launch-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  align-items: start;
  max-width: 840px;
  width: 100%;
  margin: 52px auto 0;
}

@media (max-width: 680px) {
  .case-launch-grid {
    grid-template-columns: 1fr;
  }
  .case-launch-grid > :first-child {
    max-width: 300px;
    margin: 0 auto;
  }
}

/* External link (Instagram etc.) */
.cs-external-link {
  color: var(--muted) !important;
  text-decoration: none;
  transition: color 0.12s;
}
.cs-external-link:hover { color: var(--text) !important; }
