:root {
  color-scheme: light;
  --cream: #f4ecd8;
  --cream-light: #faf4e3;
  --cream-card: #fbf5e3;
  --green: #2c3a30;
  --green-deep: #243029;
  --yellow: #d4f25b;
  --yellow-soft: rgba(212, 242, 91, 0.45);
  --yellow-band: rgba(212, 242, 91, 0.22);
  --lavender: #dadbf0;
  --peach: #f4dcd2;
  --ink: #2c3a30;
  --muted: #6b7268;
  --rule: rgba(44, 58, 48, 0.15);
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Top nav strip */
.case-nav {
  padding: 22px 32px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  letter-spacing: 0.05em;
}
.case-nav .logo {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
}
.case-nav .back {
  color: var(--muted);
  text-decoration: none;
  font-style: italic;
  font-family: var(--serif);
  font-size: 16px;
}
.case-nav .back:hover { color: var(--ink); }

.case-study {
  max-width: 880px;
  margin: 0 auto;
  padding: 72px 32px 96px;
}

/* Eyebrow + client + headline */
.eyebrow {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
  border: 1.5px solid var(--green);
  border-radius: 999px;
  padding: 7px 16px;
  margin: 0 0 22px;
  transform: rotate(-2deg);
}
.client {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 14px;
}
h1.headline {
  font-family: var(--serif);
  font-size: 57px;
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 44px;
  color: var(--ink);
  max-width: 860px;
}
h1.headline em {
  font-style: italic;
  background: linear-gradient(transparent 60%, var(--yellow) 60%);
  padding: 0 4px;
  color: var(--ink);
}

/* Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  margin: 0 0 56px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  padding: 28px 24px;
  border-right: 1px solid var(--rule);
}
.stat:last-child { border-right: 0; }
.stat .num {
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1;
  font-weight: 500;
  color: var(--green);
  margin: 0 0 10px;
  font-style: italic;
}
.stat .num span.hl {
  background: var(--yellow);
  padding: 0 6px;
  font-style: italic;
}
.stat .label {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
}

/* Chart card */
.chart-block {
  background: var(--cream-card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 30px 30px 24px;
  margin: 0 0 32px;
  box-shadow: 0 1px 0 rgba(44,58,48,0.04);
}
.chart-kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink);
  font-weight: 500;
  margin: 0 0 6px;
  opacity: 0.9;
}
.chart-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 6px;
  line-height: 1.15;
}
.chart-title em {
  font-style: italic;
  background: linear-gradient(transparent 60%, var(--yellow-soft) 60%);
  padding: 0 4px;
}
.chart-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.5;
}
.chart-legend {
  display: flex;
  gap: 22px;
  margin-top: 14px;
  font-size: 16px;
  color: var(--ink);
  flex-wrap: wrap;
  font-style: italic;
  font-family: var(--serif);
}
.chart-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
}
.chart-legend .swatch {
  display: inline-block;
  width: 16px;
  height: 10px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 6px;
  background: var(--yellow-band);
  border: 1px solid rgba(168, 192, 56, 0.7);
}

/* Section headings */
h2.section {
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 500;
  margin: 56px 0 18px;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.005em;
}
h2.section em {
  font-style: italic;
  color: var(--green);
}
h2.section .num-prefix {
  font-family: var(--serif);
  font-style: italic;
  color: var(--yellow);
  -webkit-text-stroke: 1px var(--green);
  margin-right: 12px;
}

/* Body copy */
p { margin: 0 0 18px; max-width: 740px; }
p em {
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  background: linear-gradient(transparent 65%, var(--yellow-soft) 65%);
  padding: 0 2px;
}

/* Pull quote */
.pullquote {
  border-left: 4px solid var(--yellow);
  background: var(--cream-light);
  padding: 22px 28px;
  margin: 40px 0;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.4;
  color: var(--ink);
  font-style: italic;
  border-radius: 0 6px 6px 0;
}
.pullquote cite {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
  font-style: normal;
  letter-spacing: 0.05em;
  font-family: var(--sans);
}

/* Spend concentration screenshots */
.spend-screens { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.spend-screen { margin: 0; }
.spend-screen img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.spend-screen figcaption { margin-top: 10px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); text-align: center; }
@media (max-width: 720px) {
  .spend-screens { grid-template-columns: 1fr; }
}

/* Placeholder (TODO marker) */
.placeholder {
  background: var(--yellow-band);
  border-left: 3px solid var(--yellow);
  padding: 14px 20px;
  margin: 28px 0;
  font-size: 14px;
  color: var(--green-deep);
  font-family: var(--sans);
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}
.placeholder strong {
  color: var(--green-deep);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Closing note */
.closing-note {
  margin: 36px 0 24px;
  padding: 28px 30px;
  background: var(--green);
  color: var(--cream);
  border-radius: 8px;
  font-size: 19px;
  line-height: 1.55;
  position: relative;
}
.closing-note::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 30px;
  width: 60px;
  height: 16px;
  background: var(--yellow);
  border-radius: 2px;
}
.closing-note em {
  font-style: italic;
  color: var(--yellow);
  font-weight: 500;
}

/* Engagement footer */
.engagement-footer {
  margin-top: 64px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.engagement-footer .meta-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  margin: 0 0 6px;
  font-family: var(--serif);
  font-style: italic;
  opacity: 0.9;
}
.engagement-footer .meta-value {
  font-size: 16px;
  color: var(--ink);
  font-weight: 500;
}

/* Rebuild grid */
.rebuild-grid {
  display: grid;
  grid-template-columns: 1.3fr 2fr auto 2fr;
  gap: 0;
  margin-top: 8px;
}
.rebuild-row {
  display: contents;
}
.rebuild-row > div {
  padding: 18px 16px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
}
.rebuild-row:last-child > div { border-bottom: 0; }
.rebuild-row .r-label {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.03em;
  padding-left: 0;
}
.rebuild-row .r-before {
  color: var(--muted);
  font-size: 16px;
  text-decoration: line-through;
  text-decoration-color: rgba(107, 114, 104, 0.5);
  text-decoration-thickness: 1.5px;
}
.rebuild-row .r-arrow {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 24px;
  justify-content: center;
  padding: 18px 8px;
  font-style: italic;
}
.rebuild-row .r-after {
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  background: linear-gradient(transparent 65%, var(--yellow) 65%, var(--yellow) 95%, transparent 95%);
  display: inline-block;
  padding-left: 16px;
  padding-right: 16px;
}
.rebuild-row .r-after-cell {
  background: transparent;
  padding-left: 0;
}
.rebuild-row .r-after-cell .r-after-text {
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  background: linear-gradient(transparent 60%, var(--yellow) 60%);
  padding: 0 6px;
}

/* 50/50 rule split */
.rule-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  margin-top: 8px;
  align-items: stretch;
}
.rule-half {
  padding: 24px 26px;
  background: var(--cream-light);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.rule-half:first-child { border-right: 0; border-radius: 6px 0 0 6px; }
.rule-half:last-child { border-left: 0; border-radius: 0 6px 6px 0; }
.rule-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 56px;
  line-height: 1;
  padding: 0 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.08em;
}
.rule-pct {
  font-family: var(--serif);
  font-size: 42px;
  font-style: italic;
  color: var(--green);
  line-height: 1;
  margin: 0 0 10px;
}
.rule-desc {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--ink);
}
.rule-example {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--cream);
  border-left: 3px solid var(--yellow);
  border-radius: 0 4px 4px 0;
}
.rule-example::before {
  content: "e.g.  ";
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  margin-right: 4px;
}

/* Final CTA */
.case-cta {
  margin-top: 64px;
  padding: 48px 40px;
  background: var(--green);
  color: var(--cream);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 32px;
  align-items: center;
}
.case-cta h3 {
  font-family: var(--serif);
  font-size: 35px;
  line-height: 1.1;
  font-weight: 500;
  margin: 0;
}
.case-cta h3 em {
  font-style: italic;
  color: var(--yellow);
}
.case-cta .cta-btn {
  background: var(--yellow);
  color: var(--green);
  border: 1.5px solid var(--yellow);
  padding: 16px 28px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .case-study { padding: 48px 22px 72px; }
  h1.headline { font-size: 37px; }
  h2.section { font-size: 29px; }
  .stat-row, .engagement-footer { grid-template-columns: 1fr; }
  .stat { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .stat:last-child { border-bottom: 0; }
  .stat .num { font-size: 40px; }
  .chart-title { font-size: 22px; }
  .case-cta { grid-template-columns: 1fr; padding: 32px 26px; }
  .rebuild-grid { grid-template-columns: 1fr; }
  .rebuild-row > div { padding: 10px 0; border-bottom: 0; }
  .rebuild-row { padding: 14px 0; border-bottom: 1px solid var(--rule); display: block; }
  .rule-split { grid-template-columns: 1fr; }
  .rule-half:first-child { border-radius: 6px 6px 0 0; border-right: 1px solid var(--rule); border-bottom: 0; }
  .rule-half:last-child { border-radius: 0 0 6px 6px; border-left: 1px solid var(--rule); border-top: 0; }
  .rule-divider { padding: 14px 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); border-top: 0; border-bottom: 0; font-size: 48px; }
}