/* Case study pages. Loaded after site.css, which holds the colors, fonts,
   header, footer and buttons. Everything here sits under main.cs so it
   leaves the rest of the site alone. */
.cs { font-size: 18px; line-height: 1.7; }
.cs .wrap { max-width: 1080px; padding: 0 24px; }
.cs .read { max-width: 700px; margin: 0 auto; }

/* Hero: runs up under the sticky header, like .page-head. */
.cs-hero {
  margin-top: -67px;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(52, 81, 224, 0.35), transparent 60%),
    radial-gradient(700px 360px at -10% 110%, rgba(255, 122, 122, 0.12), transparent 60%),
    var(--ink);
  color: var(--ink-text);
  padding: 155px 0 72px;
}
.cs-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-accent);
  border: 1px solid var(--ink-line-2); border-radius: 999px; padding: 6px 12px;
}
.cs-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255, 122, 122, 0.18); }
.cs-hero h1 {
  font-size: clamp(44px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 750;
  margin: 26px 0 18px;
}
.cs-hero .dek { font-size: clamp(19px, 2.3vw, 23px); line-height: 1.5; color: var(--ink-muted); max-width: 680px; margin: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; font-size: 14px; color: var(--ink-faint); }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { opacity: 0.8; }

/* Stats band */
.stats { background: var(--ink-2); border-top: 1px solid var(--ink-line); border-bottom: 1px solid var(--ink-line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 30px 24px; border-left: 1px solid var(--ink-line); }
.stat:first-child { border-left: 0; }
.stat .n { font-size: clamp(30px, 3.6vw, 40px); font-weight: 720; letter-spacing: -0.03em; color: #fff; line-height: 1.1; }
.stat .n small { font-size: 0.5em; font-weight: 600; color: var(--ink-muted); margin-left: 4px; letter-spacing: 0; }
.stat .l { margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--ink-muted); }

/* Article */
.cs article { padding: 72px 0 24px; }
.cs section.part { margin: 0 0 64px; }
.part-kicker { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.cs h2 { font-size: clamp(28px, 3.6vw, 36px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 720; margin: 0 0 22px; }
.cs h3 { font-size: 19px; line-height: 1.35; letter-spacing: -0.01em; font-weight: 680; margin: 0 0 6px; }
.cs p { margin: 0 0 20px; }
.cs .part-kicker { margin: 0 0 10px; }
.cs-lede { font-size: 21px; line-height: 1.6; }
.cs-lede::first-letter { float: left; font-size: 3.3em; line-height: 0.9; font-weight: 750; margin: 6px 10px 0 0; color: var(--accent); }
.cs strong { font-weight: 650; }
.cs .muted { color: var(--muted); }

/* "On paper" cards */
.covered { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0 26px; }
.cover-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow);
}
.cover-card .paper { padding: 20px 22px 18px; }
.cs .cover-card h3 { font-size: 18px; margin: 10px 0 6px; }
.cover-card .paper p { font-size: 15.5px; line-height: 1.55; color: var(--muted); margin: 0; }
.lbl { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.lbl.ok { color: var(--ok); }
.lbl.bad { color: var(--bad); }
.cover-card .reality {
  margin-top: auto; padding: 14px 22px 16px;
  background: var(--bad-soft); border-top: 1px solid color-mix(in srgb, var(--bad) 22%, transparent);
}
.cover-card .reality p { margin: 6px 0 0; font-size: 15.5px; line-height: 1.5; font-weight: 600; color: var(--text); }

/* Findings list */
.findings { list-style: none; padding: 0; margin: 28px 0; display: grid; gap: 12px; }
.finding {
  display: grid; grid-template-columns: 40px 1fr; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px;
}
.finding .ico {
  position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text); background: var(--bg-alt); border: 1px solid var(--line-strong);
}
.finding .ico svg { width: 19px; height: 19px; stroke-width: 1.75; }
.finding .ico::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--bad); border: 2px solid var(--surface);
}
.cs .finding p { font-size: 16.5px; line-height: 1.6; margin: 0; color: var(--muted); }
.finding .since {
  display: inline-block; margin-left: 8px; vertical-align: 2px; white-space: nowrap;
  font-size: 12px; font-weight: 650; letter-spacing: 0.01em;
  color: var(--warn); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 999px; padding: 2px 10px;
}

.cs blockquote.pull {
  margin: 44px 0; padding: 4px 0 4px 26px; border-left: 4px solid var(--accent);
  font-size: clamp(23px, 2.8vw, 28px); line-height: 1.35; letter-spacing: -0.015em; font-weight: 650;
}

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 30px 0 34px; position: relative; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 11px; top: 21px; bottom: -5px; width: 2px; background: var(--line-strong); }
.timeline li.hot:not(:last-child)::after { background: linear-gradient(color-mix(in srgb, var(--bad) 70%, transparent), var(--line-strong)); }
.timeline li { position: relative; padding: 0 0 26px 46px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--line-strong); }
.timeline li.hot::before { border-color: var(--bad); background: var(--bad-soft); }
.timeline li.key::before { border-color: var(--accent); background: var(--accent-soft); }
.timeline .when { font-family: var(--mono); font-size: 13px; color: var(--faint); letter-spacing: 0.02em; }
.timeline .what { font-size: 17px; line-height: 1.55; margin-top: 2px; }

/* Callouts */
.callout {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px 26px; margin: 30px 0;
}
.callout h3 { display: flex; align-items: center; gap: 10px; }
.cs .callout p:last-child { margin-bottom: 0; }

.issue { margin: 0 0 26px; }
.cs .issue h3 { font-size: 20px; }

.costs { list-style: none; padding: 0; margin: 24px 0 30px; display: grid; gap: 10px; }
.costs li { display: flex; gap: 14px; align-items: flex-start; font-size: 17px; line-height: 1.55; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.costs li svg { flex: none; margin-top: 4px; color: var(--bad); }

/* The Crashcart section */
.band { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 80px 0; margin: 24px 0 0; }
.manager {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center;
  margin: 34px 0 52px;
}
.manager-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  color: var(--ink-text); border-radius: var(--r-lg); box-shadow: var(--shadow);
  border: 1px solid var(--ink-line-2);
}
.manager-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, #6a84ff, #3451e0 60%, var(--mint));
}
.nb-hd { display: flex; align-items: center; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--ink-line); }
.nb-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(147, 166, 255, 0.14); color: var(--ink-accent); }
.nb-title { font-size: 15px; font-weight: 650; color: #fff; letter-spacing: -0.01em; }
.nb-sub { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.nb-live { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(74, 222, 159, 0.16); }
.nb-list { list-style: none; margin: 0; padding: 6px 22px; }
.nb-list li { padding: 14px 0; border-top: 1px solid var(--ink-line); }
.nb-list li:first-child { border-top: 0; }
.cs .nb-list p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-text); }
.nb-list code { font-family: var(--mono); font-size: 12.5px; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--ink-line-2); border-radius: 6px; padding: 1px 6px; }
.nb-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.02em; border-radius: 999px; padding: 3px 10px; }
.nb-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nb-chip.red { color: #ffa3a3; background: rgba(255, 122, 122, 0.13); }
.nb-chip.blue { color: #b4c2ff; background: rgba(147, 166, 255, 0.14); }
.nb-chip.amber { color: #ffd08a; background: rgba(247, 185, 85, 0.13); }
.nb-chip.green { color: #86efc0; background: rgba(74, 222, 159, 0.12); }
.nb-chip.violet { color: #d4b8ff; background: rgba(180, 140, 255, 0.14); }
.nb-ft { display: flex; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--ink-line); background: rgba(0, 0, 0, 0.18); font-size: 12px; color: var(--ink-faint); }
.cs .manager-copy p { font-size: 17px; }

.cs .fixes-h { font-size: 22px; margin-bottom: 4px; }
.fixes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 26px 0 34px; }
.fix {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 24px 22px; box-shadow: var(--shadow);
}
.fix .was {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px; line-height: 1.4; font-weight: 600; color: var(--bad);
}
.fix .was svg { flex: none; }
.fix .was span { color: var(--faint); font-weight: 500; }
.cs .fix h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin: 0 0 8px; }
.fix h3 .chk { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.cs .fix p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--muted); }

/* Questions */
.cs .qs { padding-top: 72px; }
.questions { counter-reset: q; list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 12px; }
.questions li {
  counter-increment: q; position: relative;
  padding: 18px 20px 18px 66px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  font-size: 17px; line-height: 1.55;
}
.questions li::before {
  content: counter(q); position: absolute; left: 18px; top: 16px;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px;
}
.questions li span { display: block; color: var(--muted); font-size: 15.5px; margin-top: 4px; }

/* Lesson and call to action */
.lesson { text-align: center; padding: 30px 0 80px; }
.cs .lesson p { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.3; letter-spacing: -0.02em; font-weight: 700; max-width: 760px; margin: 0 auto; }
.lesson p span { color: var(--accent); }

.cta { background: var(--ink); color: var(--ink-text); padding: 76px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cs .cta h2 { color: #fff; margin: 0 0 8px; }
.cs .cta p { color: var(--ink-muted); margin: 0; font-size: 17px; max-width: 560px; }

@media (max-width: 860px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--ink-line); }
  .manager { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cs { font-size: 17px; }
  .cs .wrap { padding: 0 16px; }
  .cs-hero { padding: 131px 0 52px; }
  .covered { grid-template-columns: 1fr; }
  .fixes { grid-template-columns: 1fr; }
  .finding { grid-template-columns: 1fr; gap: 10px; }
  .cs-lede { font-size: 19px; }
  .stat { padding: 22px 16px; }
}
@media print {
  .top, .cta, .foot { display: none; }
  .cs-hero { margin-top: 0; padding-top: 64px; }
  .cs-hero, .stats { background: #fff !important; color: #000; }
  .cs-hero .dek, .stat .l { color: #333; }
  .stat .n { color: #000; }
  .band { background: #fff; }
  .cover-card, .finding, .fix, .questions li { box-shadow: none; break-inside: avoid; }
}
