/* Case study pages. Loads after styles.css and reuses its tokens. */

.case-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gutter);
  background: rgba(0, 0, 0, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}
.case-bar .brand { display: flex; align-items: center; gap: 10px; }
.case-bar .back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--dim); }
.case-bar .back:hover { color: var(--accent); }

.case { display: flex; flex-direction: column; align-items: center; padding: 0 var(--gutter) 160px; }
.case > * { width: 100%; max-width: 920px; min-width: 0; }
.block > *, .figure > * { min-width: 0; }

.case-hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 120px 0 80px; text-align: center; }
.case-hero .glow { left: 50%; top: -200px; width: 900px; height: 600px; margin-left: -450px; opacity: .6; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .12em; color: var(--accent); text-transform: uppercase; }
.case-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 8vw, 104px); line-height: 1; }
.case-hero .lede { max-width: 720px; font-family: var(--serif); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; color: var(--body); }
.case-hero .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 10px; padding: 28px 24px; background: #070707; }
.stat .num { font-family: var(--serif); font-size: 48px; line-height: 1; }
.stat .num small { font-size: 22px; color: var(--muted); }
.stat .label { font-size: 14px; line-height: 1.45; color: var(--dim); }
.stat .from { font: 12px/1.4 var(--mono); color: var(--muted); }

.block { display: flex; flex-direction: column; gap: 20px; padding-top: 120px; }
.block h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 56px); line-height: 1.05; }
.block h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.15; }
.block p, .block li { font-size: 17px; line-height: 1.7; color: var(--body); }
.block code { font: 14px var(--mono); color: var(--fg); background: #141414; padding: 2px 6px; border-radius: 4px; }
.block strong { color: var(--fg); font-weight: 600; }
.kicker { font: 500 12px/1 var(--mono); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }

.figure { position: relative; margin: 12px 0 0; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #050505; }
.figure .scroll { overflow-x: auto; }
.figure figcaption { margin-top: 16px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.figure svg text { font-family: var(--mono); }

.chart-title { margin-bottom: 4px; font-size: 15px; font-weight: 600; color: var(--fg); }
.chart-sub { margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.bar-hit { cursor: default; }
.bar-hit:hover + .bar, .bar-hit:focus + .bar { filter: brightness(1.25); }

.key-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; font-size: 13px; color: var(--dim); }
.key-row span { display: inline-flex; align-items: center; gap: 8px; }
.key-row i { width: 12px; height: 12px; border-radius: 3px; }

.tip {
  position: fixed; z-index: 50; pointer-events: none;
  padding: 8px 12px; border-radius: 6px; border: 1px solid var(--sep);
  background: #111; color: var(--fg); font: 13px/1.4 var(--sans);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .6); white-space: nowrap;
}
.tip b { font-weight: 600; }
.tip span { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #070707; }
.card .tag { align-self: flex-start; padding: 4px 8px; border-radius: 4px; font: 500 11px/1 var(--mono); letter-spacing: .08em; }
.card .tag.yes { color: #000; background: var(--accent); }
.card .tag.no { color: var(--dim); border: 1px solid var(--sep); }
.card p { font-size: 15px; line-height: 1.65; }
.card .delta { font: 13px/1.4 var(--mono); color: var(--muted); }

.list { display: flex; flex-direction: column; gap: 16px; }
.list li { position: relative; padding-left: 24px; }
.list li::before { content: ''; position: absolute; left: 0; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 220px; }
thead th { font: 500 12px/1.3 var(--mono); letter-spacing: .04em; color: var(--muted); background: #0a0a0a; }
tbody td { color: var(--body); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tr.adopted td { color: var(--fg); font-weight: 600; }
tr.adopted td:first-child::before { content: '●'; margin-right: 8px; color: var(--accent); }
details.table-toggle summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; color: var(--dim); }
details.table-toggle summary:hover { color: var(--accent); }

.case-end { display: flex; flex-direction: column; align-items: center; gap: 24px; padding-top: 140px; text-align: center; }
.case-end h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6vw, 72px); line-height: 1; }
.case-end .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

@media (max-width: 760px) {
  .case-hero { padding: 72px 0 56px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 20px 16px; }
  .stat .num { font-size: 38px; }
  .block { padding-top: 88px; }
  .block p, .block li { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .figure { padding: 16px; }
  .case-bar .brand-name { display: none; }
}
