/* Case-study kit (2026-10-12; markup in partials/case-kit.njk). One layout for every case study, so a
   reader can compare them: a dark hero with the answer and three numbers, the site's progress report,
   four numbered beats on paper, one evidence gallery, then where to next. Numbers use the homepage's
   proof-strip look; beat numbers are piece blocks. A site may set --cs-accent and nothing else. */
.page-case main { --cs-accent: var(--number); --cs-accent-deep: var(--ink); }
.cs-hero { padding-block: clamp(20px, 4vw, 56px) clamp(28px, 4vw, 56px); }
.cs-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 10px; color: var(--bone-soft); font-size: .9rem; }
.cs-crumb a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.cs-hero h1 { max-width: 20ch; margin: 4px 0 14px; color: var(--bone); font: 800 var(--h1-page)/1.04 var(--face); font-stretch: 112%; letter-spacing: -.025em; text-wrap: balance; }
.cs-lede { max-width: min(100%, calc(480px + 14vw)); margin: 0; color: #d6dbe2; font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); line-height: 1.5; }
.cs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 24px 0 0; padding: 14px 0; list-style: none; border-block: 1px solid var(--field-line); max-width: 980px; }
.cs-stats li { display: grid; gap: 4px; padding: 0 14px; border-left: 1px solid var(--field-line); }
.cs-stats li:first-child { padding-left: 0; border-left: 0; }
.cs-stats strong { color: var(--cs-accent); font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem); font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.05; }
.cs-stats span { color: var(--bone-soft); font-size: .86rem; line-height: 1.35; }
@media (max-width: 599px) { .cs-stats { grid-template-columns: 1fr; gap: 10px; } .cs-stats li { grid-template-columns: 6.5em 1fr; align-items: baseline; padding: 0; border: 0; } }
.cs-routes { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }

.cs-report { padding-block: var(--section-tight); }
.cs-beats { padding-block: var(--section-tight) var(--section); }
.cs-beat { display: grid; gap: 8px 32px; padding: 28px 0; border-top: 2px solid var(--paper-line, #d0d6de); }
.cs-beat:first-child { border-top: 0; }
@media (min-width: 900px) { .cs-beat { grid-template-columns: 200px minmax(0, 1fr); } }
.cs-beat-n { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ink-soft); font-weight: 800; font-size: .95rem; }
.cs-beat-n span { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--cs-accent-deep); color: var(--sheet, #fff); font: 850 1rem/1 var(--face); border-radius: 3px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3); }
.cs-beat-body { max-width: min(100%, calc(560px + 16vw)); }
.cs-beat-body h2 { margin: 0 0 12px; font: 800 var(--h2)/1.08 var(--face); font-stretch: 112%; letter-spacing: -.02em; }
.cs-beat-body p { line-height: 1.6; }
.cs-beat-body .case-aside { padding: 12px 14px; background: var(--sheet, #fff); border-left: 0; border-top: 4px solid var(--step); border-radius: 4px; }

.cs-evidence { padding-block: var(--section-tight); }
.cs-evidence h2 { margin: 0 0 16px; font: 800 var(--h2)/1.08 var(--face); font-stretch: 112%; }
.cs-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; align-items: start; }
.cs-gallery > * { margin: 0 !important; max-width: none !important; }
.cs-gallery img { max-height: 440px; width: 100%; object-fit: cover; object-position: top; }
.cs-gallery .heatmap { grid-template-columns: 1fr !important; gap: 10px; }
.cs-gallery .heatmap-img { max-height: 440px; }
.cs-gallery .heatmap-f, .cs-gallery .heatmap-note { font-size: .92rem; }
.cs-gallery .receipt { box-shadow: 6px 6px 0 var(--piece-s); }
.cs-gallery figcaption { font-size: .85rem; line-height: 1.45; }

.cs-next { padding-block: var(--section-tight) var(--section); }
.cs-next h2 { margin: 0 0 14px; font: 800 var(--h2)/1.08 var(--face); font-stretch: 112%; }
.cs-next-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.cs-next-list a { display: grid; gap: 4px; height: 100%; padding: 14px 16px; background: var(--sheet, #fff); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; text-decoration: none; box-shadow: 4px 4px 0 var(--step); }
.cs-next-list li:first-child a { box-shadow: 4px 4px 0 var(--cs-accent); }
.cs-next-list strong { font-size: 1.05rem; }
.cs-next-list span { color: var(--ink-soft); font-size: .9rem; line-height: 1.4; }
@media (hover: hover) { .cs-next-list a:hover { background: #f7f8fa; box-shadow: 4px 4px 0 var(--cs-accent); } }

/* Pieces inside a beat (2026-10-12, when WireRef, Quack, GageRef, CheckMyTap and UpOrbit joined the kit).
   Shared by every case study, so no site needs its own page CSS. A site may also set --cs-accent-deep
   (the beat-number blocks); The Quack Report uses it for Ducks green. */
.cs-said { margin: 0 0 14px; padding-left: 14px; border-left: 4px solid var(--cs-accent-deep); font-size: 1.12rem; font-weight: 700; line-height: 1.45; }
.cs-note, .cs-beat-body .case-source-note { color: var(--ink-soft); font-size: .9rem; line-height: 1.5; }
.cs-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; padding: 0; list-style: none; }
.cs-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; background: var(--sheet); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; font-weight: 700; text-decoration: none; }
@media (hover: hover) { .cs-links a:hover { background: #f7f8fa; border-color: var(--cs-accent-deep); } }
.cs-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.cs-pair > div { padding: 12px 14px; background: var(--sheet); border-radius: 4px; border-top: 4px solid var(--step); }
.cs-pair dt { color: var(--ink-soft); font-size: .86rem; }
.cs-pair dd { margin: 4px 0 0; font-size: 1.5rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.cs-table { width: 100%; max-width: 620px; margin: 14px 0; border-collapse: collapse; background: var(--sheet); font-variant-numeric: tabular-nums; }
.cs-table caption { padding-bottom: 6px; color: var(--ink-soft); font-size: .9rem; text-align: left; }
.cs-table th, .cs-table td { padding: 8px 10px; border-bottom: 1px solid var(--paper-line); text-align: left; }
.cs-table td, .cs-table thead th + th { text-align: right; }
.cs-card { margin: 16px 0; padding: 14px 16px; background: var(--sheet); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--cs-accent); }
.cs-card > :first-child { margin-top: 0; }
.cs-card > :last-child { margin-bottom: 0; }
.cs-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.cs-quotes { display: grid; gap: 10px; margin: 14px 0; padding: 0; list-style: none; }
.cs-snaps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cs-snaps figure { margin: 0; }
.cs-gallery .cs-snaps img { aspect-ratio: 3 / 4; max-height: 260px; }
.cs-big { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* One column, one left edge, for the whole case study (Hayden, 2026-10-12: "the case studies aren't nearly
   good enough yet. design is all over the place"). The column is exactly as wide as a story beat (label plus
   reading column) and centered on the screen; hero, report, beats, evidence and next steps all start at its
   left edge, instead of each section picking its own. */
.cs .wrap { max-width: calc(232px + var(--measure) + 2 * var(--gutter)); }
main.cs .wrap > :is(h1, h2, h3, p, ul, ol, blockquote, nav, div):not(#_measure) { margin-inline: 0; }
main.cs .cs-beat { max-width: none; }
/* A hero photo, when a case study has one (2026-10-12, Hayden: use the photos "to improve heros, CTAs,
   backgrounds"): full-bleed behind the hero, darkened from the text side so every line keeps its contrast. */
.cs-hero--photo { position: relative; isolation: isolate; overflow: hidden; }
.cs-hero-bg { position: absolute; inset: 0; z-index: -2; }
.cs-hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.cs-hero--photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(20, 22, 27, .94) 0%, rgba(20, 22, 27, .86) 45%, rgba(20, 22, 27, .55) 100%); }
@media (max-width: 899px) { .cs-hero--photo::before { background: rgba(20, 22, 27, .86); } }

/* Evidence, arranged by kind (Hayden, 2026-10-12: "the evidence is just images thrown together sloppily").
   Receipts share a row at equal height and fill it evenly at any count; screenshots and heatmaps take a full
   row with the caption beside the image on desktop; photos run as an even strip; anything else takes a row. */
.cs-gallery { display: flex !important; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.cs-gallery > * { flex: 1 1 100%; min-width: 0; }
.cs-gallery > .receipt { flex: 1 1 300px; display: flex; flex-direction: column; }
.cs-gallery > .receipt img { width: 100%; height: auto; object-fit: contain; }
.cs-gallery > .receipt figcaption { flex: 1; }
.cs-gallery .receipt-open-label { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 0; color: var(--work-ink); font-weight: 800; text-decoration: underline; text-underline-offset: .2em; }
@media (min-width: 900px) {
  .cs-gallery > .heatmap { display: grid !important; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: center; }
  .cs-gallery > .heatmap img { max-height: 460px; width: auto; max-width: 100%; margin-inline: auto; display: block; border-radius: 4px; }
  .cs-gallery .cs-snaps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.cs-gallery .cs-snaps img { aspect-ratio: 4 / 5; height: auto; max-height: none; width: 100%; object-fit: cover; border-radius: 4px; }
.cs-gallery .cs-snaps figcaption { margin-top: 6px; }
/* A photo or screenshot spans the gallery with its caption beneath, so a one-line caption never leaves an empty column. */
.cs-gallery > .case-screenshot img { width: auto; max-width: 100%; height: auto; max-height: 520px; display: block; margin-inline: auto; border-radius: 4px; }
.cs-gallery > .case-screenshot figcaption { margin-top: 8px; }
@media (min-width: 900px) {
  .cs-gallery > .case-screenshot { display: grid !important; grid-template-columns: auto minmax(220px, 1fr); gap: 20px; align-items: end; }
  .cs-gallery > .case-screenshot figcaption { margin-top: 0; max-width: 34ch; }
}
/* A wide photo spans the gallery instead: the side-by-side above is for phone captures. */
.cs-gallery > .case-photo { display: block !important; }
.cs-gallery > .case-photo img { width: 100%; max-height: 460px; object-fit: cover; object-position: center 40%; }
.cs-gallery > .case-photo figcaption { margin-top: 8px; max-width: none; }
