/* ---------- Case-study building blocks shared by Praxis, ClearCalc and Car ADAS
   (same type scale, colors, radius and spacing as the Tandm page) ---------- */

/* hero band color per project, matching its home-page card */
.band-lavender { --band: var(--card-lavender); }
.band-mint { --band: var(--card-mint); }
.band-sky { --band: var(--card-sky); }

/* Placeholder for a visual that exists in the old case study and will be dropped in later */
.ph { margin: 0; }
.ph-box {
  position: relative; aspect-ratio: var(--ar, 16 / 10); border-radius: 10px;
  border: 1.5px dashed color-mix(in srgb, var(--text) 22%, transparent);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--text) 3%, transparent) 14px 15px),
    var(--ph-tint, color-mix(in srgb, var(--surface) 60%, transparent));
  display: grid; place-items: center; text-align: center; padding: 20px; overflow: hidden;
}
.ph-box > span { display: grid; gap: 6px; justify-items: center; max-width: 36ch; }
.ph-box svg { width: 28px; height: 28px; color: var(--muted); }
.ph-box b { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); color: var(--text); }
.ph-box small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.ph.tall { --ar: 4 / 5; }
.ph.square { --ar: 1; }
.ph.wide { --ar: 21 / 9; }
.ph.ph-phone { --ar: 9 / 19; max-width: 220px; width: 100%; justify-self: center; }
.ph.ph-phone .ph-box { border-radius: 22px; }
.hero-proto .ph-box { background: var(--surface); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .3); border-style: solid; border-color: var(--line); }

/* Chapter markers: the story beats */
.chapter { display: flex; align-items: baseline; gap: 14px; margin: 0 0 10px; }
.chapter .num { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h2); color: var(--muted); font-variant-numeric: tabular-nums; }
.chapter .eyebrow { margin: 0; }
.beat { margin-top: 64px; }
.beat:first-of-type { margin-top: 40px; }
.beat .split { align-items: center; }
.kicker { font-size: var(--fs-label); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }

/* Small cards: insights, problems, players */
.cards { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.cards li { padding: 20px; border-radius: var(--radius); background: var(--tint, var(--card-yellow)); }
.cards li b { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); margin-bottom: 6px; }
.cards li p { margin: 0; font-size: var(--fs-card); }
.cards li:nth-child(4n + 2) { --tint: var(--card-lavender); }
.cards li:nth-child(4n + 3) { --tint: var(--card-mint); }
.cards li:nth-child(4n + 4) { --tint: var(--card-sky); }
.chips { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 400; font-size: 15px; }

/* A step-by-step path, with the step that hurts highlighted */
.path { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 0; counter-reset: s; }
.path li { position: relative; padding: 18px 16px 16px; margin-right: 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.path li:last-child { margin-right: 0; }
.path li::after { content: "→"; position: absolute; right: -19px; top: 50%; translate: 0 -50%; color: var(--muted); }
.path li:last-child::after { display: none; }
.path b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 16px; }
.path span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.path li.hot { border-color: #d42a22; background: color-mix(in srgb, #d42a22 7%, var(--surface)); }
.path li.hot::before { content: "the bottleneck"; position: absolute; top: -10px; left: 12px; padding: 2px 8px; border-radius: 999px; background: #d42a22; color: #fff; font: 600 11px/1.4 var(--font-body); letter-spacing: .04em; }
@media (max-width: 860px) {
  .path { grid-template-columns: 1fr; gap: 22px; }
  .path li { margin-right: 0; }
  .path li::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -21px; translate: -50% 0; }
}

/* Funnel: wide exploration narrowing to one answer */
.funnel { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 8px; justify-items: center; }
.funnel li { width: var(--w); padding: 12px 18px; border-radius: 999px; background: var(--tint, var(--card-mint)); text-align: center; font-weight: 400; }
.funnel li span { color: var(--muted); font-size: 14px; }

/* Comparing options: pros, cons and a verdict */
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.option { display: flex; flex-direction: column; gap: 12px; }
.option h4 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: var(--fs-h3); }
.option dl { margin: 0; display: grid; gap: 6px; font-size: var(--fs-card); }
.option dt { font-weight: 600; }
.option dd { margin: 0 0 4px; color: var(--muted); }
.option.picked .ph-box { border-style: solid; border-color: #3fbf8a; }
.badge { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.option.picked .badge { background: #3fbf8a; color: #fff; }
@media (max-width: 860px) { .options { grid-template-columns: 1fr; } }

/* What we learned → what we changed */
.fixes { display: grid; gap: 14px; margin-top: 24px; }
.fix { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: stretch; }
.fix > div { padding: 18px 20px; border-radius: var(--radius); }
.fix > div:first-child { background: var(--card-lavender); }
.fix > div:last-child { background: var(--card-mint); }
.fix > i { display: grid; place-items: center; font-style: normal; color: var(--muted); }
.fix .kicker { margin-bottom: 4px; }
.fix p { margin: 0; }
@media (max-width: 720px) { .fix { grid-template-columns: 1fr; } .fix > i { height: 28px; rotate: 90deg; } }

/* Gallery of placeholders */
.ph-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.ph-grid figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }
@media (max-width: 720px) { .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Notes for content still to write (Car ADAS draft) */
.draft { margin-top: 20px; padding: 16px 18px; border-radius: 12px; border: 1.5px dashed #c99700; background: color-mix(in srgb, #f9d86b 14%, var(--surface)); font-size: var(--fs-card); }
.draft b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #8a6d00; margin-bottom: 4px; }
:root[data-theme="dark"] .draft b { color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px dashed var(--muted); }
.list-plain { margin: 12px 0 0; padding-left: 20px; }
.list-plain li { margin: 6px 0; }

/* hero tag sits on the colored band: give it a white chip so it stays readable */
.hero-band .tag:not(.tint-yellow) { background: var(--surface); }
/* the funnel-style stat line reads as one sentence, smaller than a hero stat */
.cs .bigstat.flow { font-size: clamp(22px, 3vw, 32px); margin: 8px 0 16px; }
/* how-might-we pairs */
.hmw-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; }
.hmw-pair > div { display: flex; flex-direction: column; gap: 12px; }
.hmw-pair .hmw { margin: 0 !important; }
.hmw-pair h3 { margin: 0; }
@media (max-width: 720px) { .hmw-pair { grid-template-columns: 1fr; } }

/* ---------- Tandm v2: artifacts that open full size, a wall of wireframes, and device renders ---------- */
.zoom { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.zoom img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.zoom-hint {
  position: absolute; right: 12px; bottom: 12px; padding: 5px 10px; border-radius: 999px;
  background: rgba(10, 12, 14, .72); color: #fff; font: 600 12px/1 var(--font-body);
  opacity: 0; translate: 0 4px; transition: opacity .25s ease, translate .25s ease;
}
.zoom:hover .zoom-hint, .zoom:focus-visible .zoom-hint { opacity: 1; translate: 0 0; }
.cs section figure.bleed .zoom img { border-radius: 10px; }

/* Wall of wireframes: shows the volume at a glance; any one opens full size */
.wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.wall button { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 6px; transition: translate .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease; }
/* full screen always shown (no cropping); one hairline frame, the same on every screen */
.wall img { display: block; width: 100%; height: auto; border-radius: 6px; border: 0; background: #fff; box-shadow: 0 0 0 .5px color-mix(in srgb, var(--text) 18%, transparent); }
.wall button:hover { translate: 0 -3px; box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .35); }
@media (max-width: 860px) { .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Hi-fi renders: two tilted devices overlapping on the project tint */
.renders {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin: 32px 0 56px;
  padding: clamp(24px, 4vw, 48px); border-radius: var(--radius); background: var(--card-yellow); overflow: hidden;
}
.renders img { width: 112%; max-width: none; height: auto; border-radius: 0 !important; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .18)); }
.renders img:last-child { margin-left: -12%; }
@media (max-width: 720px) { .renders { grid-template-columns: 1fr; } .renders img, .renders img:last-child { width: 100%; margin: 0; } }

/* Stats sitting beside text inside a beat */
.beat .stats { margin-top: 20px; }
