/* Case study template
 *
 * Shared by every case study rendered from the CMS. The five hand-built
 * pages under results/case-studies/ do NOT use this file: each of those
 * carries its own inline stylesheet and its own palette, and they are left
 * exactly as they are.
 *
 * The structure here is baby-safety-launch's, with its palette lifted into
 * variables so a case study can pick a theme without a new stylesheet.
 *
 * Themes: amber, rose, green, teal, burnt -- matching the five published
 * pages. A case study may also supply its own two colours, in which case
 * the renderer writes --accent and --ground inline on .cs-page.
 */

.cs-page {
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-mid: #555;
  --text-light: #777;
  --good: #1a8c5e;
  --good-bg: rgba(26,140,94,0.08);
  --info: #2563eb;
  --info-bg: rgba(37,99,235,0.06);
  --serif: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-lift: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
}

.cs-page.theme-amber {
  --accent: #d97706;
  --accent-dark: #b45309;
  --accent-bg: rgba(217,119,6,0.08);
  --ground: #faf8f5;
  --border: #e8e4df;
  --border-light: #f0ece7;
}

.cs-page.theme-rose {
  --accent: #8c2d4a;
  --accent-dark: #6d2239;
  --accent-bg: rgba(140,45,74,0.07);
  --ground: #fdf5f7;
  --border: #eddce2;
  --border-light: #f6e8ed;
}

.cs-page.theme-green {
  --accent: #047857;
  --accent-dark: #036249;
  --accent-bg: rgba(4,120,87,0.06);
  --ground: #fafbfa;
  --border: #dce5de;
  --border-light: #edf1ee;
}

.cs-page.theme-teal {
  --accent: #0d9488;
  --accent-dark: #0b7a70;
  --accent-bg: rgba(13,148,136,0.07);
  --ground: #f5f7f6;
  --border: #e2e8f0;
  --border-light: #edf2f7;
}

.cs-page.theme-burnt {
  --accent: #b45309;
  --accent-dark: #92400e;
  --accent-bg: rgba(180,83,9,0.06);
  --ground: #f8f7f4;
  --border: #e7e5e4;
  --border-light: #f1f0ec;
}

/* --- structure ------------------------------------------------------ */

/* Reset site CSS inside case study */
    .cs-page { padding: 96px 0 0; background: var(--ground); color: var(--text); }
    .cs-page .container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
    .cs-page h1, .cs-page h2, .cs-page h3 { font-size: inherit; line-height: inherit; letter-spacing: normal; max-width: none; margin: 0; color: inherit; }
    .cs-page .eyebrow { color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; display: inline; margin-bottom: 0; }
    .cs-page .eyebrow::before { display: none !important; }
    .cs-page p { color: inherit; font-size: inherit; line-height: inherit; }
    .cs-page img { max-width: 100%; height: auto; }
    .cs-page a { color: inherit; }

  
  
  
  

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  .cs-page { background: var(--ground); color: var(--text); font-family: var(--sans); line-height: 1.6; }
  img { max-width: 100%; height: auto; display: block; }

  /* HERO */
  .cs-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 64px 24px 56px; }
  .cs-hero-inner { max-width: 960px; margin: 0 auto; }
  .cs-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
  .cs-hero h1 { font-family: var(--serif); font-size: clamp(28px, 4.5vw, 44px); font-weight: 700; line-height: 1.15; margin-bottom: 16px; text-wrap: balance; }
  .cs-hero-lede { font-size: 18px; color: var(--text-mid); max-width: 680px; line-height: 1.6; margin-bottom: 32px; }
  .cs-meta { display: flex; flex-wrap: wrap; gap: 24px; font-size: 13px; color: var(--text-light); }
  .cs-meta span { display: flex; align-items: center; gap: 6px; }
  .cs-meta strong { color: var(--text); font-weight: 600; }

  /* STAT STRIP */
  .stat-strip { padding: 40px 24px; }
  .stat-strip-inner { max-width: 960px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stat-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 28px 20px; text-align: center; position: relative; overflow: hidden; }
  .stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent); }
  .stat-card .stat-value { font-family: var(--serif); font-size: clamp(28px, 4vw, 38px); font-weight: 700; color: var(--accent); line-height: 1.1; margin-bottom: 6px; }
  .stat-card .stat-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-mid); }

  /* Long figures.
   *
   * The sizes above suit short values -- "489", "3.73x", "£17.3K". A full
   * figure such as "$100,418.20" is wider than the card, and .stat-card
   * clips its overflow, so the end of the number vanished without a trace.
   *
   * CSS cannot size text by its own length, so the renderer adds one of
   * these classes from the value's character count (cs_len_class).
   * overflow-wrap is the last resort: a value longer than anything
   * anticipated wraps rather than being silently cut off.
   */
  .stat-card .stat-value,
  .metric-pill .mv,
  .velocity-text .peak { overflow-wrap: anywhere; }

  /* The lower bound of each clamp is what a phone gets. At 375px a stat card
   * leaves about 118px of room, and an 11-character serif figure needs ~121px
   * at 20px -- three pixels over, enough to wrap the number mid-digit and
   * render "$100,418.2" above "0", which reads as two numbers rather than one.
   * The floors below leave real headroom instead of just clearing it. */
  .stat-card .stat-value.len-m  { font-size: clamp(20px, 3.2vw, 31px); }
  .stat-card .stat-value.len-l  { font-size: clamp(17px, 2.6vw, 26px); }
  .stat-card .stat-value.len-xl { font-size: clamp(15px, 2.2vw, 21px); }

  .metric-pill .mv.len-m  { font-size: 20px; }
  .metric-pill .mv.len-l  { font-size: 18px; }
  .metric-pill .mv.len-xl { font-size: 16px; }

  .velocity-text .peak.len-m  { font-size: 36px; }
  .velocity-text .peak.len-l  { font-size: 30px; }
  .velocity-text .peak.len-xl { font-size: 25px; }

  /* CONTENT */
  .cs-content { max-width: 960px; margin: 0 auto; padding: 56px 24px; }
  .cs-section { margin-bottom: 64px; }
  .cs-section:last-child { margin-bottom: 0; }
  .cs-section h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; margin-bottom: 20px; }
  .cs-section p { font-size: 16px; color: var(--text-mid); line-height: 1.7; margin-bottom: 16px; max-width: 720px; }

  /* PROCESS STEPS */
  .process-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
  .process-step { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 24px 24px 24px 56px; position: relative; }
  .step-num { position: absolute; left: 20px; top: 24px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
  .process-step h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
  .process-step p { font-size: 14px; color: var(--text-mid); line-height: 1.55; margin: 0; max-width: none; }

  /* EVIDENCE SECTION */
  .evidence-block { margin-top: 48px; }
  .evidence-block h3 { font-family: var(--serif); font-size: 20px; font-weight: 700; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); display: inline-block; }
  .evidence-block .evidence-subtitle { font-size: 14px; color: var(--text-light); margin-bottom: 20px; }
  .evidence-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
  .evidence-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; }
  .evidence-card.full-width { grid-column: 1 / -1; }
  .evidence-card-label { padding: 12px 16px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 8px; }
  .evidence-card-label .badge { background: var(--accent); color: #fff; font-size: 10px; padding: 2px 8px; border-radius: 10px; letter-spacing: 0; text-transform: none; font-weight: 600; }
  .evidence-card img { width: 100%; display: block; }
  .evidence-card-body { padding: 16px; position: relative; overflow: hidden; }
  .evidence-card-body::after {
    content: 'Mohsin Raza';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-family: var(--serif);
    font-size: 28px;
    font-weight: 700;
    color: rgba(0,0,0,0.08);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    z-index: 2;
  }
  

  /* SUMMARY METRICS ROW */
  .metrics-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
  .metric-pill { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; text-align: center; }
  .metric-pill .mv { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; font-variant-numeric: tabular-nums; }
  .metric-pill .mv.brand { color: var(--accent); }
  .metric-pill .mv.green { color: var(--good); }
  .metric-pill .mv.blue { color: var(--info); }
  .metric-pill .ml { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); margin-top: 2px; }

  /* GROWTH CHART IMAGE */
  .growth-chart-img { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; margin-top: 24px; }
  .growth-chart-img img { width: 100%; }

  /* REORDER BANNER */
  .reorder-banner { background: var(--good-bg); border: 1px solid var(--good); border-radius: var(--radius); padding: 28px 32px; margin-top: 32px; display: flex; align-items: center; gap: 20px; }
  .reorder-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--good); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
  .reorder-banner h4 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
  .reorder-banner p { font-size: 14px; color: var(--text-mid); margin: 0; }

  /* PEAK VELOCITY */
  .velocity-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 28px 32px; margin-top: 16px; display: flex; align-items: center; gap: 32px; }
  .velocity-text .peak { font-family: var(--serif); font-size: 42px; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 4px; }
  .velocity-text h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
  .velocity-text p { font-size: 14px; color: var(--text-mid); margin: 0; max-width: none; }

  /* WHY IT WORKED */
  .why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
  .why-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 24px; border-left: 3px solid var(--accent); }
  .why-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
  .why-card p { font-size: 14px; color: var(--text-mid); line-height: 1.55; margin: 0; max-width: none; }

  /* SERVICES */
  .services-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
  .service-tag { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 0.02em; box-shadow: var(--shadow-card); }

  /* CTA */
  .cs-cta { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 24px; text-align: center; }
  .cs-cta h2 { font-family: var(--serif); font-size: 28px; font-weight: 700; margin-bottom: 12px; }
  .cs-cta p { font-size: 16px; color: var(--text-mid); max-width: 560px; margin: 0 auto 28px; line-height: 1.6; }
  .cs-cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
  .btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 28px; border-radius: 8px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: all 0.2s; }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: var(--accent-dark); }
  .btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
  .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

  /* DISCLAIMER */
  .cs-disclaimer { max-width: 960px; margin: 0 auto; padding: 0 24px 56px; font-size: 13px; color: var(--text-light); line-height: 1.6; border-top: 1px solid var(--border-light); padding-top: 24px; }

  /* RESPONSIVE */
  @media (max-width: 768px) {
    .stat-strip-inner { grid-template-columns: repeat(2, 1fr); }
    .evidence-pair { grid-template-columns: 1fr; }
    .services-row { grid-template-columns: repeat(2, 1fr); }
    .velocity-card { flex-direction: column; text-align: center; }
  }
  @media (max-width: 480px) {
    .stat-strip-inner { grid-template-columns: 1fr 1fr; gap: 12px; }
    /* Narrower padding buys back ~16px for long figures. */
    .stat-card { padding: 22px 12px; }
    .process-steps { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    .services-row { grid-template-columns: 1fr 1fr; }
    .metrics-row { grid-template-columns: 1fr 1fr; }
  }
