/* CaseModel website: css/kit.css
   The pieces the overview and the capability pages share: a page of evidence as a card, the line from a figure to its page,
   labels that say what a thing is, the head of a capability's page, and the frame a worked example sits in. */

/* ---- the wordmarks ---- */
.wm { display: inline-flex; align-items: baseline; white-space: nowrap; font-family: var(--display); font-weight: 800; letter-spacing: -.03em; position: relative; }
.wm svg { flex: none; width: auto; height: .74em; margin-right: .012em; overflow: visible; display: inline-block; }
.wm .wm-a { color: var(--azure); } .wm .wm-n { color: var(--navy); }


/* ---- a page of evidence, small ---- */
.pcard { width: 290px; padding: 14px 16px 16px; background: #fff; border: 1px solid #9cc6ff; border-radius: 8px; box-shadow: 0 14px 40px rgb(0 40 96 / .16); }
.pcard-h { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); font: 600 13.5px/1.2 var(--display); }
.pcard-h b { color: var(--azure-dd); font-weight: 700; } .pcard-h span { color: var(--text-3); }
.pcard i { display: block; height: 7px; margin-top: 10px; border-radius: 2px; background: #d6e2f0; }
.pcard i:nth-of-type(1) { width: 62%; } .pcard i:nth-of-type(2) { width: 78%; }
.pcard q { display: flex; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 9px 11px; background: var(--sky-4); border-radius: 4px; font: 600 16.5px/1.25 var(--ui); color: var(--navy); quotes: none; }
.pcard.said q, .pcard.done q { box-shadow: inset 0 -2px 0 var(--red); background: var(--red-bg); }
.pcard small { display: block; margin-bottom: 8px; font: 700 12.5px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ---- the line from a figure down to its page ---- */
.chain { list-style: none; margin: 0; padding: 0; }
.chain li { position: relative; padding: 0 0 20px 34px; opacity: 0; transform: translateY(8px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.chain li.in { opacity: 1; transform: none; }
.chain li::before { content: ''; position: absolute; left: 4px; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--azure); z-index: 1; }
.chain li::after { content: ''; position: absolute; left: 9.5px; top: 12px; bottom: -6px; width: 2px; background: var(--azure); opacity: .45; }
.chain li:last-child::after { display: none; }
.chain li:first-child::before { border-color: var(--gold-d); background: var(--gold); }
.chain small { display: block; font: 700 12.5px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.chain b { display: block; margin-top: 4px; font: 700 17.5px/1.3 var(--display); color: var(--navy); letter-spacing: -.01em; }
.chain b i { font-style: normal; font-weight: 600; color: var(--text-3); margin-left: 6px; white-space: nowrap; }
/* on a phone a long note after the name moves to the next line whole, and wraps only if it is wider than the line */
@media (max-width: 560px) { .chain b i { display: inline-block; margin-left: 0; white-space: normal; text-wrap: balance; } }
.chain q { display: block; margin-top: 8px; padding: 9px 12px; background: var(--sky-4); border-radius: 4px; font: 600 16.5px/1.3 var(--ui); color: var(--navy); quotes: none; }
.chain li.struck::before { border-color: var(--text-3); background: var(--text-3); }
/* a head of loss that falls is struck through, in grey: red is kept for the other side caught out */
.chain li.fell::before { border-color: var(--text-3); background: #fff; } .chain li.fell b i { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--text-3); }
.chain li.open::before { border-color: var(--orange); background: #fff; } .chain li.open::after, .chain li.struck::after, .chain li.fell::after { background: var(--line); opacity: 1; }
.chain p { margin: 5px 0 0; font-size: 16px; line-height: 1.45; color: var(--text-2); }
.tally { margin-top: 4px; padding: 16px 18px; border-radius: 8px; background: var(--sky-3); opacity: 0; transition: opacity .5s var(--ease); }
.tally.in { opacity: 1; }
.tally b { font: 800 26px/1 var(--display); color: var(--navy); letter-spacing: -.02em; }
.tally s { font: 700 18px/1 var(--display); color: var(--text-3); margin-right: 10px; }
.tally span { display: block; margin-top: 6px; font-size: 15.5px; color: var(--text-2); }


/* a reference to a page: it names the document and the page */
cite, .cite { font: 600 13.5px/1 var(--display); font-style: normal; color: var(--azure-dd); background: #fff; border: 1px solid var(--edge); border-radius: 4px; padding: 2px 7px; white-space: nowrap; }

/* ---- labels that say what a thing is. Red: the other side caught out. Orange: open. Azure: a step or a change.
   Navy, ruled round: settled (it stands, it is closed, confirmed or applied) ---- */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 4px; font: 700 12.5px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--azure-dd); background: var(--sky-4); white-space: nowrap; }
.tag.adv { color: var(--red-d); background: var(--red-bg); } .tag.open { color: var(--orange-d); background: var(--orange-bg); } .tag.ok { color: var(--navy); background: #fff; box-shadow: inset 0 0 0 1.5px var(--navy); }

/* ---- the head of a capability's page: where it sits in a case, its name, what it does, its film ---- */
.ph { padding: calc(var(--top) + clamp(40px, 6vw, 84px)) 0 clamp(40px, 4.5vw, 64px); background: linear-gradient(180deg, var(--sky-2), #fff 78%); }
.ph-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
/* under the rail, the head needs no room for the header */
.rail + main > .ph:first-child { padding-top: clamp(36px, 5vw, 72px); }
.ph-where { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font: 700 14px/1.2 var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.ph-where .step-n { letter-spacing: 0; }
.ph h1 { font-size: clamp(42px, 5.2vw, 78px); font-weight: 800; letter-spacing: -.04em; line-height: .98; }
/* a head whose name is a wordmark, or a whole sentence, is set a little smaller */
.ph h1:has(.wm) { font-size: clamp(38px, 4.4vw, 62px); }
/* the wordmark's C stands on the column's edge, as the first letter of the lines below it does; the trail of squares runs
   out into the margin to its left (.6367em is where the C starts within the mark). On a phone the trail keeps 4 px of the
   gutter, so none of it is cut by the edge of the screen */
.ph h1 .wm { margin-left: max(-.6367em, calc(4px - var(--gut))); }
.ph .lede { margin-top: 24px; color: var(--text); }
.ph-get { margin-top: 26px; font-size: 17px; color: var(--text-2); }
.ph-get li { margin-bottom: 8px; }
.ph-film .film { box-shadow: var(--sh-3); }
@media (max-width: 900px) { .ph-in { grid-template-columns: 1fr; } }

/* ---- a worked example: a frame with its own short heading, and one thing to do ---- */
.demo { border: 1px solid var(--line); border-radius: var(--r-l); background: #fff; box-shadow: var(--sh-2); overflow: hidden; }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px clamp(18px, 2.4vw, 28px); border-bottom: 1px solid var(--line-2); background: var(--sky-1); }
.demo-bar p { margin: 0; font: 600 15.5px/1.3 var(--display); color: var(--text-2); }
.demo-body { padding: clamp(20px, 3vw, 40px); }
.demo-note { margin: 14px 4px 0; font-size: 14.5px; color: var(--text-3); }

/* a choice between a few views of one thing: the chosen one is filled */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--sky-4); gap: 2px; }
.seg button { min-height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: none; font: 600 15px/1 var(--display); color: var(--text-2); transition: background .22s var(--ease), color .22s var(--ease), box-shadow .22s var(--ease); }
.seg button:hover { color: var(--navy); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgb(0 40 96 / .16); }
/* on a narrow window the choice spans its frame; its buttons share each row and take a second row when they must */
@media (max-width: 560px) {
  .seg { display: flex; flex-wrap: wrap; width: 100%; border-radius: 26px; }
  .seg button { flex: 1 1 auto; min-height: 44px; padding: 0 10px; font-size: 14.5px; }
}

/* a switch: one thing on or off */
.sw { display: inline-flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; font: 600 16px/1.2 var(--display); color: var(--navy); text-align: left; }
.sw i { flex: none; position: relative; width: 46px; height: 26px; border-radius: 999px; background: #c5d3e4; transition: background .22s var(--ease); }
.sw i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 40 96 / .3); transition: transform .22s var(--ease); }
.sw[aria-pressed="true"] i { background: var(--navy); } .sw[aria-pressed="true"] i::after { transform: translateX(20px); }

/* a document, set as a document: who, when, and the words that matter marked */
.doc { padding: 18px 20px 20px; background: #fff; border: 1px solid var(--edge); border-radius: 8px; box-shadow: var(--sh-1); font-size: 16px; line-height: 1.5; color: var(--text); }
.doc-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); font: 600 13.5px/1.3 var(--display); }
.doc-h b { color: var(--azure-dd); font-weight: 700; } .doc-h span { color: var(--text-3); }
.doc-m { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--text-3); }
.doc-m b { color: var(--text-2); font-weight: 600; }
.doc p { margin: 0 0 .6em; }
.doc mark { padding: 1px 3px; margin: 0 -3px; border-radius: 3px; background: var(--sky-4); color: var(--navy); font-weight: 600; box-shadow: inset 0 -2px 0 var(--azure); }
.doc mark.red { background: var(--red-bg); color: var(--red-dd); box-shadow: inset 0 -2px 0 var(--red); }
.doc mark.orange { background: var(--orange-bg); color: var(--orange-dd); box-shadow: inset 0 -2px 0 var(--orange); }
/* a mark that starts straight after a letter, with no space before it, keeps clear of that letter */
.doc mark.tight { margin-left: 0; padding-left: 1px; }

/* a figure, said large, with what it counts under it */
.stat b { display: block; font: 800 clamp(34px, 3.6vw, 54px)/1 var(--display); color: var(--navy); letter-spacing: -.035em; }
.stat span { display: block; margin-top: 8px; font: 600 15.5px/1.3 var(--display); color: var(--text-3); }

/* where a capability works in the model: the model, with that part forward and the rest stood back */
.locate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.locate-fig { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-l); overflow: hidden; background: linear-gradient(#fff, #eff7ff 55%, #e2effc); border: 1px solid var(--line); }
.locate-fig canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.locate h2 { font-size: clamp(26px, 2.6vw, 38px); }
.locate p { margin-top: 16px; color: var(--text-2); }
@media (max-width: 900px) { .locate { grid-template-columns: 1fr; } }

/* a capability's film keeps its place as the overview hands to its page */
.cap-view .film, .ph-film .film { view-transition-name: page-film; }

/* the head of a page that shows the model beside its words, drawn with one part forward (js/part.js) */
.ph-pic { position: relative; aspect-ratio: 16 / 11; border-radius: var(--r-l); overflow: hidden; background: linear-gradient(#fff, var(--sky-2) 55%, var(--sky-4)); border: 1px solid var(--line); }
.ph-pic canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 900px) { .ph-pic { aspect-ratio: 5 / 4; } }
/* a head with nothing to show beside its words (no scripts to draw the model or play the film, or a film place given up)
   gives the room to the words */
html:not(.js) .ph-pic, html:not(.js) .ph-film, .ph-film[hidden] { display: none; }
html:not(.js) .ph-in:has(> .ph-pic, > .ph-film), .ph-in:has(> .ph-film[hidden]) { grid-template-columns: minmax(0, 1fr); }
/* a phone on its side: the picture at the head fits the window under the header, so it can be seen whole */
@media (max-width: 900px) and (orientation: landscape) {
  .ph-pic { aspect-ratio: auto; height: calc(100vh - var(--top) - 32px); height: calc(100svh - var(--top) - 32px); }
  /* and so does a film, with its mark and its length */
  .ph-film .film, .cap-view .film { width: min(100%, calc((100vh - var(--top) - 32px) * 16 / 9)); width: min(100%, calc((100svh - var(--top) - 32px) * 16 / 9)); margin-inline: auto; }
}

/* ---- where a finger may press them, on a touch screen of any size, every control can be pressed over 44 px. The small
   buttons, the choices, the header's entries and the questions put to the assistant are drawn 44 px high; a switch, a link
   that goes on, the links into CaseModel's own parts and the name of the next page keep their look and are pressed over
   more than they show. In the narrow menu the links into CaseModel's own parts take a finger's row each ---- */
@media (any-pointer: coarse) {
  .btn.sm, .seg button, .nav > a, .nav-btn, .chat-qs button { min-height: 44px; }
  .sw, a.go, .mm-more a { position: relative; }
  .sw::before, a.go::before, .mm-more a::before { content: ''; position: absolute; left: 0; right: 0; top: calc(50% - 22px); bottom: calc(50% - 22px); }
  .next h2 a { padding-top: 4px; }
}
@media (any-pointer: coarse) and (max-width: 1040px) {
  .mm-more { gap: 0; }
  .mm-more a { min-height: 44px; padding: 12px 0; }
}
