body.case-study { min-height: 100vh; }

.case-nav { gap: 16px; }
.case-nav-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink3);
  text-decoration: none;
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 3px;
}
.case-nav-back:hover {
  color: var(--ink);
  background: rgba(0,0,0,.05);
}

.case-hero {
  padding: 48px 40px 44px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--chassis);
}
.case-hero-inner { max-width: 900px; margin: 0 auto; }
.case-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink3);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.case-eyebrow strong { color: var(--red); font-weight: 500; }
.case-title {
  font-family: var(--cond);
  font-size: clamp(40px, 7vw, 66px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}
.case-title-accent { color: var(--red); }
.case-lead {
  font-family: var(--cond);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink2);
  line-height: 1.35;
  margin-bottom: 28px;
  max-width: 720px;
}
.case-metrics { margin-top: 8px; }
.metric-delta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-top: 8px;
  line-height: 1.35;
}
.metric-delta--positive { color: var(--green); }
.metric-delta--neutral { color: var(--ink3); }

.case-study .section h2 {
  font-family: var(--cond);
  font-size: clamp(24px, 3.5vw, 28px);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.15;
}
.case-study .section > p,
.case-prose {
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.7;
  margin-bottom: 14px;
  max-width: 720px;
}
.case-study .section > p:last-child { margin-bottom: 0; }

.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}
.problem-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  padding: 16px 18px;
  border-radius: 8px;
}
.problem-item p {
  margin: 0;
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.55;
  max-width: none;
}

.context-callout {
  margin-top: 20px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.context-callout-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--red);
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}
.context-callout p {
  font-size: 14px;
  color: var(--ink2);
  margin: 0;
  line-height: 1.6;
  max-width: none;
}

.case-output-line {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--red);
  letter-spacing: 0.05em;
  margin: 18px 0 10px;
}

.case-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.case-list li {
  font-size: 14px;
  color: var(--ink2);
  line-height: 1.55;
  padding: 6px 0 6px 22px;
  position: relative;
  border-top: 1px solid var(--border);
}
.case-list li:first-child { border-top: none; padding-top: 0; }
.case-list li::before {
  content: '//';
  position: absolute;
  left: 0;
  top: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink3);
}
.case-list li:first-child::before { top: 1px; }

.pipeline {
  margin-top: 26px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.pipeline-track {
  display: flex;
  gap: 0;
  min-width: 700px;
}
.pipe-stage { flex: 1; position: relative; }
.pipe-stage-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-right: none;
  padding: 14px 16px;
  min-height: 100%;
  transition: background 0.15s;
}
.pipe-stage:last-child .pipe-stage-inner {
  border-right: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
}
.pipe-stage:first-child .pipe-stage-inner {
  border-radius: 8px 0 0 8px;
}
.pipe-stage-inner:hover { background: #FAFAF8; }
.pipe-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pipe-desc {
  font-size: 12px;
  color: var(--ink2);
  line-height: 1.45;
}
.pipe-arrow {
  position: absolute;
  right: -9px;
  top: 50%;
  width: 18px;
  height: 18px;
  background: var(--chassis);
  border: 1px solid var(--border);
  border-left: none;
  border-bottom: none;
  transform: translateY(-50%) rotate(45deg);
  z-index: 2;
}

.deploy-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 22px;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.deploy-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink3);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 400;
  background: #FAFAF8;
}
.deploy-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink2);
  vertical-align: top;
}
.deploy-table tr:last-child td { border-bottom: none; }
.deploy-table tbody tr:hover td { background: var(--chassis); }
.deploy-table .dealer-name {
  color: var(--ink);
  font-weight: 500;
}

.ctag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 3px;
  margin-right: 4px;
  margin-bottom: 4px;
}
.ctag-blue { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(24,95,165,.2); }
.ctag-green { background: var(--green-bg); color: var(--green); border: 1px solid rgba(59,109,17,.2); }
.ctag-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(161,92,0,.2); }

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.stack-item {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}
.stack-item:hover { border-color: var(--border-strong); }
.stack-name {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.stack-role {
  font-size: 12px;
  color: var(--ink2);
  line-height: 1.4;
}

.outcome-block {
  background: var(--green-bg);
  border: 1px solid rgba(59,109,17,.22);
  border-left: 4px solid var(--green);
  padding: 24px 28px;
  border-radius: 0 8px 8px 0;
  margin-top: 22px;
}
.outcome-block p {
  color: var(--ink2);
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  max-width: none;
}
.outcome-block p + p { margin-top: 12px; }
.outcome-block em {
  color: var(--ink);
  font-style: italic;
  font-weight: 500;
}

.gtm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.gtm-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 8px;
}
.gtm-card-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--teal);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.gtm-card p {
  font-size: 13px;
  color: var(--ink2);
  margin: 0;
  line-height: 1.5;
  max-width: none;
}

.case-pullquote {
  margin-top: 20px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.case-pullquote p {
  font-size: 14px;
  color: var(--ink2);
  margin: 0;
  line-height: 1.65;
  max-width: none;
}

.relevance {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: 8px;
  margin-top: 22px;
  position: relative;
  overflow: hidden;
}
.relevance::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--purple);
  opacity: 0.85;
}
.relevance p { max-width: none; }
.relevance > .case-prose:first-of-type { margin-bottom: 16px; }
.relevance-footer {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink3);
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.04em;
}

@keyframes caseFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .case-hero-animate,
  .case-metrics,
  .case-study .section {
    animation: caseFadeUp 0.45s ease both;
  }
  .case-metrics { animation-delay: 0.08s; }
  .case-study .section:nth-of-type(1) { animation-delay: 0.1s; }
  .case-study .section:nth-of-type(2) { animation-delay: 0.14s; }
  .case-study .section:nth-of-type(3) { animation-delay: 0.18s; }
  .case-study .section:nth-of-type(4) { animation-delay: 0.22s; }
  .case-study .section:nth-of-type(5) { animation-delay: 0.26s; }
  .case-study .section:nth-of-type(6) { animation-delay: 0.3s; }
  .case-study .section:nth-of-type(7) { animation-delay: 0.34s; }
}

@media (max-width: 700px) {
  .case-hero { padding-left: 20px; padding-right: 20px; }
  .case-nav-back { font-size: 12px; }
  .case-eyebrow { font-size: 12px; }
  .pipe-name { font-size: 11px; }
  .deploy-table th { font-size: 11px; }
  .ctag { font-size: 12px; }
  .stack-name { font-size: 12px; }
  .gtm-card-label { font-size: 12px; }
  .relevance-footer { font-size: 12px; }
  .case-list li::before { font-size: 11px; }
  .case-output-line { font-size: 12px; }
  .problem-grid { grid-template-columns: 1fr; }
  .gtm-grid { grid-template-columns: 1fr; }
}
