/* Case study page layout. Tokens and type roles come from system.css; the nav, closing, footer, video player and placeholders from chrome.css.
   The page reads top to bottom: who, the video, the results, then what was built, in sections split by hairlines. */

/* Hero: back link, the client's logo, the headline, the summary, then the facts in a hairline row */
.case-hero { padding: var(--space-9) 0 0; }
.back { display: inline-flex; align-items: center; gap: 4px; padding: 12px 0; margin: -12px 0; font: var(--type-small); color: var(--muted); text-decoration: none; }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--ink); }
.case-hero .logo, .case-hero .wordmark { margin-top: var(--space-8); color: var(--ink); }
.case-hero h1 { margin-top: var(--space-6); max-width: 16em; font: var(--type-display-2); letter-spacing: var(--track-display-2); }
.case-hero .sub { margin-top: var(--space-5); max-width: 36em; font: var(--type-body-l); letter-spacing: var(--track-body); color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: var(--space-8) 0 0; border-top: 1px solid var(--line); }
.facts > div { padding: var(--space-4) var(--space-5) 0 0; }
.facts > div + div { padding-left: var(--space-5); border-left: 1px solid var(--line); }
.facts dt { font: var(--type-small); color: var(--muted); }
.facts dd { margin: var(--space-1) 0 0; }
.draft-note { margin-top: var(--space-5); display: inline-block; padding: 6px 12px; border-radius: var(--r-tile); background: var(--sage); color: var(--forest); font: var(--type-small); }

/* Results: the figures large in the serif, in Forest, split by hairlines */
.case-results { margin-top: var(--section); }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: var(--head-gap); border-top: 1px solid var(--line); }
.figures > div { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-5) var(--space-6) 0 0; }
.figures > div + div { padding-left: var(--space-6); border-left: 1px solid var(--line); }
.figures b { font: var(--type-display-1); letter-spacing: var(--track-display-1); color: var(--forest); font-weight: 400; }
.figures span { max-width: 18em; font: var(--type-small); color: var(--muted); }

/* Receipt: the screenshot the numbers come from, in a hairline frame */
.receipt { margin-bottom: 0; }
.receipt img { display: block; width: 100%; height: auto; border-radius: var(--r-card); border: 1px solid var(--line); box-shadow: 0 24px 48px -32px rgb(var(--shade) / 28%); }
.receipt figcaption { margin-top: var(--space-3); font: var(--type-small); color: var(--muted); }

/* Sections: the heading on the left, the story on the right */
.case-sec { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-8); margin-top: var(--section); padding-top: var(--space-6); border-top: 1px solid var(--line); }
.case-sec h2 { font: var(--type-display-3); letter-spacing: var(--track-display-3); font-weight: 400; }
.sec-body p { max-width: 36em; font: var(--type-body-l); letter-spacing: var(--track-body); color: var(--ink-2); }
.sec-body p + p { margin-top: var(--space-4); }
.sec-body p + .items { margin-top: var(--space-6); }
.items { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.items li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.items .t { display: grid; gap: 2px; }
.items b { font-weight: 500; }
.items .t span { color: var(--ink-2); }
.items .tray { flex: none; display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border-radius: var(--r-pill); background: var(--glass-bg); box-shadow: var(--glass-edge); }
.items .tray img { width: 17px; height: 17px; }

/* Quote: centred, in the serif */
.case-quote { margin: var(--section) auto 0; max-width: 920px; text-align: center; }
.case-quote blockquote { margin: 0; }
.case-quote p { font: var(--type-display-3); letter-spacing: var(--track-display-3); }
.case-quote p::before { content: "\201C"; }
.case-quote p::after { content: "\201D"; }
.case-quote figcaption { display: grid; gap: 2px; margin-top: var(--space-6); }
.case-quote figcaption b { font-weight: 500; }
.case-quote figcaption span { font: var(--type-small); color: var(--muted); }

@media (max-width: 860px) {
  .case-sec { grid-template-columns: 1fr; gap: var(--space-5); }
}
.case-hero + .case-video { margin-top: var(--space-9); }
/* The video and the receipt no wider than 880 px, centred (Tim: "too wide") */
.case-video, .receipt { max-width: 880px; margin-inline: auto; }
.receipt { margin-top: var(--space-8); }

@media (max-width: 560px) {
  .case-hero { padding-top: var(--space-8); }
  .case-hero + .case-video { margin-top: var(--space-8); }
  .case-hero .logo, .case-hero .wordmark { margin-top: var(--space-7); }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .facts > div:nth-child(n + 3) { margin-top: var(--space-4); }
  .figures { grid-template-columns: 1fr; }
  .figures > div + div { padding-left: 0; border-left: 0; margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--line); }
  .items li { align-items: flex-start; flex-direction: column; gap: var(--space-3); }
}
