/* The case figures share type, spacing and surfaces with the rest of the portfolio. */
:root {
  --figure-copy: 400 15px/1.55 var(--font-body);
  --figure-title: 600 16px/1.4 var(--font-body);
  --figure-label: 500 13px/1.45 var(--font-body);
  --figure-space: 24px;
  --figure-line: 1px solid var(--rule);
}
.case-body, .pattern-sample {container-type:inline-size}
.story-cards, .story-table, .story-flow, .story-conclusion {margin:var(--figure-space) 0;font:var(--figure-copy)}
.story-cards {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr));gap:var(--figure-space)}
.story-cards > *, .convergence li {border:1px solid var(--rule);border-radius:12px;background:#faf8f4}
.story-cards > * {padding:16px;margin:0;min-width:0}
.story-cards strong, .story-flow strong {display:block;font:var(--figure-title);color:var(--ink)}
.story-cards small {display:block;font:var(--figure-label);color:var(--muted);margin-bottom:4px}
.story-cards p, .story-flow p {font:var(--figure-copy);color:var(--muted)}
.story-cards > p > strong {margin-bottom:8px}
.story-cards section p, .story-flow li p {margin:8px 0 0}
.story-table {border-collapse:collapse;width:100%;table-layout:fixed;color:var(--ink)}
.story-table :is(th,td) {padding:12px 14px;text-align:left;vertical-align:top;border:1px solid var(--rule);overflow-wrap:break-word}
.story-table thead th {background:#faf8f4;font:var(--figure-label);color:var(--muted)}
.story-table tbody th {font-weight:600}
.story-table th:first-child {width:28%}
.story-table .selected {background:var(--surface-soft)}
.story-table small {display:block;font:var(--figure-label);color:var(--site-accent);margin-top:4px}
.story-conclusion {background:var(--surface-soft);border-left:3px solid var(--site-accent);padding:16px 20px}
.story-conclusion p {margin:0}
.story-flow {display:flex;list-style:none;padding:0}
.story-flow li {flex:1;min-width:0;position:relative;padding:22px 14px 0 0}
.story-flow li::before {content:"";position:absolute;left:0;top:4px;width:100%;height:1px;background:var(--rule)}
.story-flow li:last-child::before {display:none}
.story-flow li::after {content:"";position:absolute;left:0;top:0;width:9px;height:9px;border:2px solid var(--site-accent);border-radius:50%;background:var(--surface);box-sizing:border-box}
@container (max-width: 46rem) {
  .story-flow:has(li:nth-child(5)) {display:block}
  .story-flow:has(li:nth-child(5)) li {padding:0 0 18px 24px}
  .story-flow:has(li:nth-child(5)) li::before {left:4px;top:7px;width:1px;height:100%}
  .story-flow:has(li:nth-child(5)) li::after {top:7px}
}
@container (max-width: 30rem) {
  .story-flow {display:block}
  .story-flow li {padding:0 0 18px 24px}
  .story-flow li::before {left:4px;top:7px;width:1px;height:100%}
  .story-flow li::after {top:7px}
  .story-table :is(th,td) {padding:10px 5px}
  .story-table th:first-child {width:30%}
}

/* The three row colors, tile lift and perspective selection follow adoption journey v5. */
.matrix-story {--night:var(--surface-inverse);--v:#c9df8d;--c:#bdb3ea;--a:#edbc8a;margin:24px 0;border-radius:var(--radius);background:var(--night);color:#dce8cf}
.role-matrix {overflow-x:auto}
.role-matrix table {width:100%;border-spacing:0;table-layout:fixed;font:var(--figure-copy)}
.role-matrix th,.role-matrix td {padding:12px 14px;text-align:left;vertical-align:top}
.role-matrix th:first-child {width:19%}
.role-matrix thead th {color:#dce8cf;font-weight:500;vertical-align:bottom}
.role-matrix tr:nth-child(1) {--tone:var(--v)}
.role-matrix tr:nth-child(2) {--tone:var(--c)}
.role-matrix tr:nth-child(3) {--tone:var(--a)}
.role-matrix tbody th {color:var(--tone);font-weight:500}
.role-matrix tbody :is(th,td) {border-top:1px solid #354b37}
.role-matrix td {border-left:1px solid #354b37;background:var(--night);color:#c7d4bd;transition:opacity .45s,background .45s}
.role-matrix td.active {background:color-mix(in srgb,var(--tone) 12%,var(--night));box-shadow:inset 0 2px var(--tone);color:#edf2df}
.role-matrix td.unknown {opacity:.64}
.role-matrix .pin {display:table;margin-top:8px;padding:2px 6px;border-radius:3px;background:var(--tone);color:#213321;font:500 11px/1.4 var(--font-body)}



.matrix-caption {padding:16px 20px;border-top:1px solid #3b5239;background:#213726;border-radius:0 0 10px 10px}
.matrix-caption p {margin:0;color:#e1ecd8;font-size:15px}
.role-name {display:block}
@media(min-width:901px) and (prefers-reduced-motion:no-preference){
  .chapter:not([hidden]) .role-1 {view-transition-name:frontline}
  .chapter:not([hidden]) .role-2 {view-transition-name:admin}
  .chapter:not([hidden]) .role-3 {view-transition-name:cto}
  ::view-transition-group(frontline),::view-transition-group(admin),::view-transition-group(cto) {animation-duration:650ms}
}

@media(max-width:700px){
  .role-matrix table {min-width:610px}
  .role-matrix th:first-child {position:sticky;left:0;background:var(--night);z-index:1}

}
@media(prefers-reduced-motion:reduce){.role-matrix td {transition:none}}

/* A note frames the narrative, while the contents rail marks navigation. */
.case-note {margin:24px 0;padding:18px 22px;background:var(--surface-soft);border-radius:12px}
.case-note p {margin:6px 0 0}
.note-tag,.logic-figure small,.pulse-diagram small,.lens-label {display:block;font:600 12px/1.45 var(--font-body);letter-spacing:.055em;text-transform:uppercase;color:var(--site-accent)}
.matrix-story {background:transparent}
.lens-label {margin-bottom:8px}




.role-matrix {background:var(--night)}
.compact-role {display:none}
.logic-figure {margin:28px 0;padding:0;font:var(--figure-copy);color:var(--ink)}
.logic-figure small {margin-bottom:7px}





.logic-result,.prompt-root {padding:16px;background:var(--surface-soft);border-radius:var(--radius)}
.logic-result strong,.prompt-root strong {font:var(--figure-title)}
.branching {display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.5fr);gap:68px;align-items:center}
.prompt-root,.branches>div {position:relative}
.branches {display:grid}
.branches>div {padding:12px 16px;background:var(--surface-soft)}
.branches>div:first-child {margin-bottom:12px}
.branches p {margin:0 0 8px}
.branches strong,.branches span {display:block}
.branches span {color:var(--muted);font:var(--figure-label)}
.investment li strong {color:#666b65}
.investment li::after {border-color:#aaa}
.investment .chosen {--stage-color:var(--site-accent)}
.investment .deferred {--stage-color:#953d48}
.investment :is(.chosen,.deferred) strong,.investment small {color:var(--stage-color)}
.investment :is(.chosen,.deferred)::after {background:var(--stage-color);border-color:var(--stage-color)}
.investment small {display:inline-block;margin-top:6px;padding:2px 7px;border-radius:4px;background:color-mix(in srgb,var(--stage-color) 9%,var(--surface));font:var(--figure-label)}
@container (max-width:32rem) {



 .branching {display:block}
 .branches {padding:16px 0 0 38px}
}
@container (max-width:38rem) {
 .matrix-story {display:flex;flex-direction:column}
 .matrix-caption {order:0;border-radius:0}
 .role-matrix {order:1;overflow:visible;border-radius:0 0 var(--radius) var(--radius)}
 .role-matrix table {min-width:0;width:100%;display:block}
 .role-matrix thead {position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
 .role-matrix tbody,.role-matrix tr,.role-matrix td {display:block}
 .role-matrix tbody th:first-child {display:block;width:100%;position:static;max-width:none;background:#23382c;font-size:16px}
 .role-matrix td {margin:5px 10px;padding:10px 12px;border:1px solid transparent;border-radius:7px}
 .role-matrix td.active {border-color:var(--tone);background:color-mix(in srgb,var(--tone) 18%,var(--night));box-shadow:inset 3px 0 var(--tone)}
 .role-matrix tbody th:first-child {margin-bottom:6px}
 .role-matrix tbody tr {padding-bottom:6px}
 .compact-role {display:block;font:600 13px/1.5 var(--font-body);color:var(--on-dark);margin-bottom:3px}

}
.branches {grid-auto-rows:1fr;row-gap:12px}
.branches>div:first-child {margin-bottom:0}

.branches>div {border-radius:var(--radius);padding:16px;display:flex;flex-direction:column;justify-content:center}
.branches p {margin:0 0 14px}
.branches small {margin-bottom:4px}
.branches strong {font:500 15px/1.5 var(--font-body)}
.investment .stage-heading {display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 8px}
.investment .stage-heading small {margin:0;color:#fff;background:var(--stage-color);font:600 12px/1.45 var(--font-body)}
.investment :is(.chosen,.deferred) p {margin:6px 0 0 10px;padding:0;color:var(--stage-color)}
@container (min-width:46.01rem) {
 .investment {display:grid;grid-template-columns:.8fr 1.36fr 1.04fr 1.27fr .8fr}
}

/* Editorial tabs above the model; hover and focus expose the available action. */
.perspectives {display:flex;gap:12px;margin:0 0 12px}
.perspectives button {flex:1;min-width:0;min-height:44px;padding:10px 4px;border:0;border-bottom:2px solid var(--rule);border-radius:0;background:transparent;color:var(--muted);text-align:left;cursor:pointer;font:500 14px/1.45 var(--font-body)}
.perspectives button:hover {color:var(--site-accent);background:var(--surface-soft);text-decoration:none}
.perspectives button[aria-pressed=true] {border-color:transparent;background:var(--site-accent);color:var(--on-dark);font-weight:700}
.perspectives button:focus-visible {outline:3px solid var(--site-focus);outline-offset:2px}

.convergence {--arm:34px;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:calc(2 * var(--arm));align-items:center}
.convergence ul {display:grid;grid-auto-rows:1fr;gap:8px;list-style:none;margin:0;padding:0}
.convergence li {position:relative;display:flex;align-items:center;padding:10px 12px}
.convergence-inputs {position:relative}
@container(max-width:34rem){
 .perspectives {gap:5px;flex-direction:column}
 .perspectives button {padding:9px 12px}
 .convergence {--arm:19px}
 .convergence li,.convergence .logic-result {padding:9px}
}
.branching,.convergence {position:relative}
.logic-arrows {position:absolute;inset:0;width:100%;height:100%;pointer-events:none;fill:none;stroke:var(--site-accent);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}

@media(max-width:675px){
 .matrix-story .perspectives {display:flex;flex-direction:column;gap:0}
 .perspectives button[aria-expanded] {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;scroll-margin-top:calc(var(--header-height,57px) + 76px)}
 .perspectives button[aria-expanded]::after {content:"";flex:none;width:7px;height:7px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg)}
 .perspectives button[aria-expanded=true]::after {transform:rotate(225deg)}
 .perspectives > div {margin-bottom:8px}
 .matrix-story .role-matrix td:not(.active) {opacity:1;color:#afc0af;font-size:13px;line-height:1.45;padding:6px 12px;margin-block:2px}
 .role-matrix td:not(.active) .compact-role {font-size:12px;color:#bacaba;margin-bottom:1px}
}

@media(max-width:675px){
 .perspectives button[aria-expanded=true] {border-radius:8px 8px 0 0}
 .perspectives .matrix-caption {background:#e5eee8;border:0;padding:14px 16px;border-radius:0 0 8px 8px;margin-bottom:12px}
 .perspectives .matrix-caption p {color:#20231f;line-height:1.55}
 .perspectives .role-matrix {border-radius:8px;overflow:hidden}
 .perspectives .role-matrix tbody th:first-child {
   padding:10px 16px;border:0;font-weight:700;color:#172b20;
   background:var(--tone);background:color-mix(in srgb,var(--tone) 55%,#f4f1ea)
 }
 .perspectives .role-matrix tbody td:not(.active) {border-color:transparent}
}
