/* CASE STUDY SHARED STYLES — applies to all engagements/[slug].html pages */

/* DESIGN TOKENS — match index.html light Ditto theme */
:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f3f5f7;
  --surface-3: #eaf4fc;
  --surface-tint: #dcedff;
  --accent: #0871ea;
  --accent-hover: #0663d0;
  --accent-deep: #256dc2;
  --accent-glow: rgba(8,113,234,0.10);
  --text: #18181b;
  --text-muted: #52525b;
  --text-dim: #71717a;
  --border: #e4e4e7;
  --border-soft: #f3f5f7;
  --success: #07bc0c;
  --error: #ef4444;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, 'system-ui', 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  line-height: 1.65;
}

/* TYPOGRAPHY — Inter throughout, no italic serif anywhere */
h1 {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -1px;
  color: var(--text);
}
h2 { font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; color: var(--text); }
h3 { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.3px; color: var(--text); }
h4 { font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -0.2px; color: var(--text); }
p { font-size: 16px; line-height: 1.7; color: var(--text-muted); }

.label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.8px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button { cursor: pointer; border: none; outline: none; font-family: inherit; }

.container { max-width: 880px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 40px; } }

/* HEADER */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
@media (min-width: 768px) { .header-inner { padding: 0 40px; } }

.logo {
  font-weight: 700; font-size: 18px;
  color: var(--text); letter-spacing: -0.5px;
  text-decoration: none;
}
.logo span { color: var(--accent); }
.logo:hover { color: var(--text); }

.back-link {
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px;
  transition: all 0.2s;
}
.back-link:hover {
  color: var(--accent); background: var(--surface-2);
}
.back-link svg { width: 16px; height: 16px; }

/* HERO */
.case-hero {
  padding: 56px 0 40px;
  background: linear-gradient(180deg, var(--surface-3) 0%, var(--bg) 80%);
}
.case-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.case-tag {
  font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.case-tag.industry { background: var(--accent-glow); color: var(--accent); border-color: rgba(8,113,234,0.25); }
.case-tag.type-full-time { background: var(--accent-glow); color: var(--accent); border-color: rgba(8,113,234,0.25); }
.case-tag.type-consulting { background: #dff4e9; color: #22a56d; border-color: rgba(34,165,109,0.25); }
.case-tag.type-family { background: #fce8e6; color: #d44d3d; border-color: rgba(212,77,61,0.25); }
.case-tag.duration { background: transparent; color: var(--text-dim); border: none; padding-left: 0; }

.case-hero-layout {
  display: flex; align-items: flex-start; gap: 28px;
}
.case-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.case-icon svg { width: 32px; height: 32px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Company-logo variant — used in engagement page hero. Auto-width brand badge. */
.case-icon.company-logo {
  width: auto;
  min-width: 72px;
  height: 72px;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.case-icon.company-logo img {
  height: 72px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
}
@media (max-width: 700px) {
  .case-icon.company-logo { height: 56px; min-width: 56px; }
  .case-icon.company-logo img { height: 56px; max-width: 200px; }
}
.case-hero-text { flex: 1; min-width: 0; }

.case-headline {
  font-size: 17px; color: var(--text-muted);
  line-height: 1.6; margin-top: 18px;
  max-width: 680px;
}

.case-top-metric {
  margin-top: 32px;
  font-size: 44px; font-weight: 700;
  letter-spacing: -1.2px; line-height: 1.05;
  color: var(--accent);
  max-width: 720px;
}

@media (max-width: 700px) {
  .case-hero-layout { flex-direction: column; gap: 16px; }
  .case-icon { width: 56px; height: 56px; }
  .case-icon svg { width: 28px; height: 28px; }
  h1 { font-size: 32px; letter-spacing: -0.6px; }
  h2 { font-size: 24px; }
  .section-title { font-size: 24px; }
  .case-top-metric { font-size: 34px; letter-spacing: -0.8px; }
}

/* STAT STRIP */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
}
.stat-cell {
  background: #ffffff; border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  text-align: left;
  transition: all 0.2s;
}
.stat-cell:hover { border-color: var(--accent); }
.stat-cell .stat-value {
  font-size: 30px; font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.8px; line-height: 1.1;
}
.stat-cell .stat-label {
  font-size: 12px; color: var(--text-muted);
  margin-top: 8px; line-height: 1.4;
}
@media (max-width: 700px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-cell { padding: 16px 14px; }
  .stat-cell .stat-value { font-size: 24px; }
}

/* SECTION BASE */
.case-section { padding: 56px 0; }
.case-section + .case-section { padding-top: 0; }
.section-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.section-title {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.5px; margin-bottom: 24px;
  line-height: 1.28;
}
.case-prose p {
  font-size: 17px; color: var(--text);
  line-height: 1.75; margin-bottom: 16px;
  max-width: 720px;
}
.case-prose p:last-child { margin-bottom: 0; }

/* ACTIONS LIST */
.actions-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
  max-width: 760px;
}
.actions-list li {
  position: relative; padding-left: 32px;
  font-size: 16px; color: var(--text); line-height: 1.65;
}
.actions-list li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 18px; height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230871ea' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: contain; background-repeat: no-repeat;
}

/* BEFORE/AFTER TABLE */
.ba-section { padding: 0 0 56px; }
.ba-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ba-table {
  width: 100%; border-collapse: collapse;
}
.ba-table thead th {
  background: var(--surface-2);
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim);
  padding: 14px 20px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.ba-table thead th:not(:first-child) { text-align: center; }
.ba-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14.5px; color: var(--text);
  vertical-align: middle;
}
.ba-table tbody tr:last-child td { border-bottom: none; }
.ba-table tbody td.metric-name { font-weight: 600; }
.ba-table tbody td.metric-value {
  text-align: center; font-family: 'Inter', sans-serif;
  font-weight: 600; color: var(--text);
}
.ba-table tbody td.metric-value.before { color: var(--text-dim); text-decoration: line-through; text-decoration-thickness: 1px; opacity: 0.8; }
.ba-table tbody td.metric-value.after { color: var(--text); }
.ba-table tbody td.metric-delta {
  text-align: center; font-weight: 700;
  color: var(--success);
  font-size: 14.5px;
}
.ba-table tbody td.metric-delta.negative { color: var(--accent); }
@media (max-width: 700px) {
  .ba-table thead th { padding: 10px 14px; font-size: 10px; letter-spacing: 1px; }
  .ba-table tbody td { padding: 12px 14px; font-size: 13px; }
}

/* BAR CHART */
.chart-wrap {
  margin-top: 32px; padding: 28px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.chart-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-bottom: 20px;
}
.chart-row {
  display: grid; grid-template-columns: 120px 1fr 80px;
  align-items: center; gap: 16px;
  margin-bottom: 14px;
}
.chart-row:last-child { margin-bottom: 0; }
.chart-label {
  font-size: 13px; font-weight: 600;
  color: var(--text);
}
.chart-bar-track {
  height: 28px;
  background: var(--surface-2);
  border-radius: 6px;
  position: relative; overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep) 0%, var(--accent) 100%);
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.chart-bar-fill.before {
  background: linear-gradient(90deg, #d4d4d8 0%, #a8a8af 100%);
}
.chart-value {
  font-size: 14px; font-weight: 700;
  color: var(--text); text-align: right;
}
@media (max-width: 700px) {
  .chart-row { grid-template-columns: 80px 1fr 60px; gap: 10px; }
  .chart-label { font-size: 12px; }
  .chart-bar-track { height: 22px; }
  .chart-value { font-size: 12px; }
}

/* INSIGHT */
.insight-block {
  background: var(--surface-tint);
  border-left: 3px solid var(--accent);
  padding: 24px 28px;
  border-radius: 0 12px 12px 0;
  max-width: 780px;
}
.insight-block p {
  font-size: 18px; line-height: 1.6;
  color: var(--text); font-weight: 500;
  margin: 0;
}
@media (max-width: 700px) {
  .insight-block { padding: 18px 20px; }
  .insight-block p { font-size: 17px; }
}

/* TOOLS AND PLATFORMS USED — Option A logo card grid */
.cs-tools {
  display: flex; flex-direction: column;
  gap: 28px;
  max-width: 880px;
}
.cs-tools-group {}
.cs-tools-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 12px;
}
.cs-tools-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
@media (max-width: 700px) { .cs-tools-grid { gap: 10px; } }

.cs-tool {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  flex: 0 0 168px; /* fixed card width — short rows just pack left */
  min-width: 0;
  transition: all 0.2s;
}
@media (max-width: 700px) {
  .cs-tool { flex: 0 0 calc((100% - 20px) / 3); padding: 14px 8px; gap: 8px; }
}
@media (max-width: 480px) {
  .cs-tool { flex: 0 0 calc((100% - 10px) / 2); }
}
.cs-tool:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(8,113,234,0.10);
  transform: translateY(-2px);
}
/* When .cs-tool is rendered as an anchor (clickable outbound link),
   it inherits color and removes the underline. */
a.cs-tool { text-decoration: none; color: inherit; }
a.cs-tool:hover { color: inherit; }

/* Company logo in hero is wrapped in an anchor when companyLinks has a URL. */
.case-icon-link { display: inline-flex; text-decoration: none; transition: opacity 0.2s; }
.case-icon-link:hover { opacity: 0.85; }
/* Option 2 layout — fixed logo HEIGHT, variable width.
   Matches the portfolio page treatment so wide logos (Tableau, Mailchimp) don't render tiny. */
.cs-tool-icon {
  height: 52px;
  width: 100%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cs-tool-icon img {
  height: 46px; width: auto; max-width: 100%;
  object-fit: contain; display: block;
  border-radius: 6px;
}
.cs-tool-icon svg { height: 46px; width: auto; }
.cs-tool-icon.channel {
  background: var(--accent-glow);
  border-radius: 12px;
  width: 36px; height: 36px;
  padding: 8px;
}
.cs-tool-icon.channel svg {
  width: 20px; height: 20px;
  stroke: var(--accent); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.cs-tool-icon.fallback {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-glow);
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
}
.cs-tool-name {
  font-size: 13px; font-weight: 600;
  color: var(--text); line-height: 1.3;
}
.cs-tool-sub {
  font-size: 11px; color: var(--text-muted);
  line-height: 1.3;
}
@media (max-width: 700px) {
  .cs-tool { padding: 14px 8px; gap: 8px; }
  .cs-tool-icon, .cs-tool-icon.fallback { width: 38px; height: 38px; }
  .cs-tool-icon svg { width: 38px; height: 38px; }
  .cs-tool-name { font-size: 12px; }
}

/* TESTIMONIAL */
.testimonial-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  max-width: 780px;
}
.testimonial-card blockquote {
  font-size: 17px; color: var(--text);
  line-height: 1.7;
  margin: 0 0 20px;
  position: relative; z-index: 1;
  border-left: 3px solid var(--accent);
  padding-left: 20px;
}
.testimonial-meta {
  display: flex; align-items: center; gap: 12px;
  position: relative; z-index: 1;
}
.testimonial-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: 0.3px;
}
.testimonial-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.3;
}
.testimonial-title {
  font-size: 12.5px; color: var(--text-muted);
  font-weight: 500; margin-top: 2px;
}
@media (max-width: 700px) {
  .testimonial-card { padding: 24px 22px; }
  .testimonial-card blockquote { font-size: 15.5px; }
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 56px;
  background: var(--surface);
  margin-top: 64px;
  text-align: center;
}
footer .footer-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
  transition: all 0.2s;
  margin-bottom: 20px;
}
footer .footer-cta:hover { background: var(--accent-hover); color: #fff; }
footer p { font-size: 13px; color: var(--text-dim); }

/* PRINT-FRIENDLY (so case studies print well for PDF export) */
@media print {
  header { position: static; border-bottom: 1px solid var(--border); }
  .case-section { page-break-inside: avoid; }
  .testimonial-card { page-break-inside: avoid; }
}

/* ===== REDESIGN EXTENSION (preview, additive) — matches homepage language ===== */
html{scroll-padding-top:84px;}
@media (prefers-reduced-motion: no-preference){ html{scroll-behavior:smooth;} }
a:focus-visible,button:focus-visible,.back-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px;}
.case-headline{text-wrap:balance;}
.section-title{position:relative;}
.section-title::after{content:"";display:block;height:3px;width:54px;margin-top:14px;border-radius:2px;background:linear-gradient(90deg,var(--accent),#d4882a);}
@media(hover:hover) and (pointer:fine){
  .stat-cell{transition:transform .3s cubic-bezier(.22,.61,.36,1),box-shadow .3s,border-color .3s;}
  .stat-cell:hover{transform:translateY(-4px);box-shadow:0 12px 28px rgba(8,40,90,.10);}
}
.case-hero{position:relative;overflow:hidden;}
.case-hero>*{position:relative;z-index:1;}
.case-hero::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;opacity:.7;
  background:radial-gradient(42% 60% at 12% 8%,rgba(8,113,234,.10),transparent 70%),radial-gradient(36% 50% at 92% 0%,rgba(212,136,42,.08),transparent 70%);}
/* Scroll reveal — gated so unsupported browsers (and reduced-motion) never hide content.
   Tables (.ba-section) and charts are intentionally NOT opacity-animated so metrics never depend on an effect. */
@media (prefers-reduced-motion: no-preference){
  @supports (animation-timeline: view()){
    .case-section{opacity:0;animation:csReveal linear both;animation-timeline:view();animation-range:entry 0% entry 38%;}
    @keyframes csReveal{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:none}}
  }
}
/* ===== end extension ===== */

/* Breadcrumb (SEO + orientation) */
.breadcrumb{max-width:880px;margin:0 auto;padding:18px 24px 0;font-size:13px;color:#71717a;display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.breadcrumb a{color:#71717a;text-decoration:none;}
.breadcrumb a:hover{color:var(--accent);}
.breadcrumb span[aria-current]{color:#18181b;}
