/* case-studies.css — case-study pages + index.
   Loaded after blog.css, which supplies the tokens, chrome, .prose and .post-cta.
   Card geometry matches the SVG asset set handed over with the content
   (16px radius, #243449 hairline) so the charts sit flush in their frames. */

.cs-main { padding-top: 56px; padding-bottom: 96px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* honeypot — off-screen, never focusable by sighted users */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- article -------------------------------------------------------------- */

.cs-article { max-width: 70ch; margin: 0 auto; }

.cs-hero { margin: 24px 0 0; }

.cs-title {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 800;
  font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.03em;
  margin: 14px 0 0; color: var(--ink);
}

.cs-strapline {
  font-size: 19px; line-height: 1.5; color: var(--green);
  margin: 16px 0 0; font-weight: 500;
}

.cs-facts {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin: 24px 0 0; padding: 18px 0 0; border-top: 1px solid var(--grid);
  font-size: 13px; color: var(--ink);
}
.cs-facts li { display: flex; flex-direction: column; gap: 4px; }
.cs-facts span {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-dim);
}

.cs-challenge {
  font-size: 16px; line-height: 1.65; color: var(--ink-mute); margin: 20px 0 0;
}
.cs-challenge strong { color: var(--ink); font-weight: 600; }

/* ---- charts --------------------------------------------------------------- */

.cs-figure {
  margin: 32px 0 0; background: var(--bg-2);
  border: 1px solid #243449; border-radius: 16px; padding: 14px; overflow: hidden;
}
.cs-figure img { width: 100%; height: auto; display: block; border-radius: 8px; }
.cs-figure figcaption {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; line-height: 1.5;
  color: var(--ink-dim); margin: 14px 2px 2px;
}
.cs-figure-hero { margin-top: 32px; }

/* ---- ledger tables --------------------------------------------------------
   The two-column tables in the copy are the spare-capacity ledgers — the number
   the whole page turns on. blog.css has no table rules, so they're styled here
   to read as a data block rather than loose text. */

.prose table {
  width: 100%; margin: 24px 0 0; border-collapse: collapse;
  background: var(--bg-2); border: 1px solid #243449; border-radius: 16px;
  overflow: hidden; font-size: 15.5px;
}
.prose thead:empty { display: none; }
.prose th, .prose td {
  padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--grid);
  color: var(--ink-mute); vertical-align: baseline;
}
.prose tr:last-child td, .prose tr:last-child th { border-bottom: 0; }
/* right-hand column carries the figure */
.prose td:last-child, .prose th:last-child {
  font-family: "IBM Plex Mono", monospace; color: var(--ink);
  text-align: right; white-space: nowrap;
}
.prose td strong, .prose th strong { color: var(--green); font-weight: 600; }

@media (max-width: 480px) {
  .prose table { font-size: 14px; }
  .prose th, .prose td { padding: 11px 13px; }
}

/* ---- result stat block ---------------------------------------------------- */

.cs-stat {
  margin: 48px 0 0; padding: 32px 28px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid #243449; border-radius: 16px;
  box-shadow: var(--shadow-md, 0 8px 24px -6px rgba(0, 0, 0, .5));
}
.cs-stat-value {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 800;
  font-size: clamp(40px, 7vw, 64px); line-height: 1; letter-spacing: -.04em;
  color: var(--green); margin: 0;
}
.cs-stat-label {
  font-size: 17px; line-height: 1.55; color: var(--ink); margin: 16px 0 0;
  max-width: 46ch;
}
.cs-stat-benchmark {
  font-size: 12.5px; line-height: 1.6; color: var(--ink-dim);
  margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--grid);
}

/* the "Why It Matters" pull-quote reads as a callout, not a nested aside */
.cs-prose-why { margin-top: 48px; }
.cs-prose-why blockquote {
  margin: 24px 0 0; padding: 24px 26px; border-left: 3px solid var(--amber);
  background: var(--bg-2); border-radius: 0 16px 16px 0;
}
.cs-prose-why blockquote p {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 600;
  font-size: clamp(19px, 2.4vw, 23px); line-height: 1.42; letter-spacing: -.015em;
  color: var(--ink); margin: 0;
}

/* ---- features chips ------------------------------------------------------- */

.cs-features { margin: 48px 0 0; }
.cs-features-head, .cs-sources-head {
  font-family: "IBM Plex Mono", monospace; font-weight: 500; font-size: 12px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim);
  margin: 0 0 16px;
}
.cs-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.cs-chip {
  font-size: 13px; line-height: 1.3; color: var(--ink-mute);
  background: var(--surface); border: 1px solid var(--grid);
  border-radius: 999px; padding: 7px 14px;
}

/* ---- sources footer ------------------------------------------------------- */

.cs-sources {
  margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--grid);
}
.cs-sources p { font-size: 14px; line-height: 1.65; color: var(--ink-mute); margin: 0; }

/* ---- forms (PDF download + notify-me) ------------------------------------- */

.cs-pdf {
  margin: 48px 0 0; padding: 30px 28px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid #243449; border-radius: 16px;
}
.cs-pdf h2 {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 22px;
  letter-spacing: -.02em; color: var(--ink); margin: 0;
}
.cs-pdf p { color: var(--ink-mute); font-size: 15.5px; line-height: 1.6; margin: 12px 0 0; max-width: 52ch; }

.cs-pdf-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.cs-pdf-row input[type=email] {
  flex: 1 1 240px; min-width: 0; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--grid); border-radius: 10px;
  padding: 12px 14px;
}
.cs-pdf-row input[type=email]::placeholder { color: var(--ink-dim); }
.cs-pdf-row input[type=email]:focus-visible {
  outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent;
}
.cs-pdf-row button { flex: 0 0 auto; }

.consent {
  display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-mute);
}
.consent input { margin-top: 3px; accent-color: var(--green); flex: 0 0 auto; }
.consent a { color: var(--green); }

.cs-form-err { color: var(--red); font-size: 13.5px; margin: 12px 0 0; }
.cs-form-ok { color: var(--green); font-size: 15.5px; line-height: 1.6; margin: 0; }
.cs-pdf .cs-form-ok { margin-top: 4px; }

/* ---- index ---------------------------------------------------------------- */

.cs-index-head { max-width: 68ch; margin-bottom: 44px; }
.cs-index-head h1 {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 800;
  font-size: clamp(32px, 5vw, 50px); line-height: 1.1; letter-spacing: -.03em;
  margin: 14px 0 0; color: var(--ink);
}
.cs-index-sub { color: var(--ink-mute); font-size: 17px; line-height: 1.65; margin: 18px 0 0; max-width: 62ch; }

.cs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.cs-card {
  display: flex; flex-direction: column; text-decoration: none;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid #243449; border-radius: 16px; overflow: hidden;
  transition: transform 240ms cubic-bezier(.22, .61, .36, 1),
              border-color 240ms cubic-bezier(.22, .61, .36, 1),
              box-shadow 240ms cubic-bezier(.22, .61, .36, 1);
}
.cs-card:hover, .cs-card:focus-visible {
  transform: translateY(-3px); border-color: var(--green-deep);
  box-shadow: var(--shadow-lg, 0 24px 60px -12px rgba(0, 0, 0, .6));
}
.cs-card-thumb { display: block; background: var(--bg); border-bottom: 1px solid var(--grid); }
.cs-card-thumb img { width: 100%; height: 172px; object-fit: cover; object-position: top center; display: block; }

.cs-card-body { display: flex; flex-direction: column; padding: 20px 22px 22px; flex: 1; }
.cs-card-meta { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.cs-card-title {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 18px;
  line-height: 1.3; letter-spacing: -.015em; color: var(--ink); margin-top: 12px;
}
.cs-card-stat {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-size: 30px;
  line-height: 1; letter-spacing: -.03em; color: var(--green); margin-top: 20px;
}
.cs-card-result { font-size: 14.5px; line-height: 1.55; color: var(--ink-mute); margin-top: 10px; }
.cs-card-more { font-size: 12.5px; color: var(--green); margin-top: auto; padding-top: 20px; }

/* ---- notify-me ------------------------------------------------------------ */

.cs-notify {
  margin: 32px 0 0; padding: 32px 30px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid #243449; border-radius: 16px;
}
.cs-notify h2 {
  font-family: "Archivo", system-ui, sans-serif; font-weight: 700; font-size: 22px;
  letter-spacing: -.02em; color: var(--ink); margin: 0;
}
.cs-notify-copy p { color: var(--ink-mute); font-size: 15.5px; line-height: 1.6; margin: 10px 0 0; max-width: 52ch; }

@media (max-width: 560px) {
  .cs-main { padding-top: 36px; }
  .cs-stat, .cs-pdf, .cs-notify { padding-left: 20px; padding-right: 20px; }
  .cs-pdf-row button { width: 100%; }
}
