/* ============================================================
   case.css: shared layout for the case study STORY pages
   (first used by case-studies/cgiar.html, 2026-10-05).

   Built to be reused: a page picks its accent with one class on
   <body>: case--cgiar | case--xymbia | case--marham | case--ds.
   That sets --case (accent: highlighted words, lines, markers) and
   --case-tint (soft section backgrounds).

   Every colour comes from css/colors.css. Fonts (2026-10-06): Fraunces
   400 for display, Instrument Sans for everything else. No italics.
   Raspberry is NOT used on case study pages: links, ticks and the
   progress line are near-black (Arwa, 2026-10-06).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap');
@import url('colors.css');
@import url('header.css');

:root{
  --serif: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;  /* headings: Geist since 2026-10-11 (Arwa) */
  --sans:  'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:  'Geist', ui-sans-serif, system-ui, sans-serif;  /* labels: small sentence-case text, no monospace (2026-10-06) */
  --hand:  'Geist', ui-sans-serif, system-ui, sans-serif;  /* handwriting font removed 2026-10-06 */
  --measure: 66ch;
  --shell: 1220px;
  --gutter: clamp(20px, 5vw, 56px);
}

/* ---- per-page accent ---- */
.case--cgiar { --case:var(--cs-cgiar);  --case-tint:var(--cs-cgiar-tint);  --case-text:var(--cs-cgiar); }
.case--xymbia{ --case:var(--cs-xymbia); --case-tint:var(--cs-xymbia-tint); --case-text:var(--cs-xymbia); }
.case--marham{ --case:var(--cs-marham); --case-tint:var(--cs-marham-tint); --case-text:var(--cs-marham); }
.case--ds    { --case:var(--cs-ds);     --case-tint:var(--cs-ds-tint);     --case-text:var(--cs-ds-text); }

*{ box-sizing:border-box; margin:0; padding:0; }
em, i, cite{ font-style:normal; font-weight:500; }
html{ background:var(--bg); scroll-behavior:smooth; scroll-padding-top:24px; }
body{
  background:var(--bg); color:var(--ink);
  font-family:var(--sans); font-size:17px; line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
img, svg{ display:block; max-width:100%; }
a{ color:var(--ink); text-decoration-thickness:1px; text-underline-offset:3px; }
a:hover{ color:var(--ink-dim); }

/* clear focus outline on every link and button */
a:focus-visible, button:focus-visible{
  outline:2px solid var(--ink); outline-offset:3px; border-radius:4px;
}

/* ---- skip link + back link ---- */
.case-skip{
  position:absolute; left:12px; top:-60px; z-index:100;
  min-height:44px; display:inline-flex; align-items:center;
  padding:10px 16px; background:var(--ink); color:var(--bg);
  border-radius:6px; font-size:14px; font-weight:500; text-decoration:none;
}
.case-skip:focus{ top:12px; color:var(--bg); }
.case-back{
  display:inline-flex; align-items:center; gap:8px; min-height:44px;
  margin:18px 0 0 var(--gutter);
  font-family:var(--mono); font-size:13px;  
  color:var(--ink); text-decoration:none;
}
.case-back:hover{ color:var(--ink-dim); }

/* ---- labels, tags, captions ---- */
.case-label{
  display:inline-block; font-family:var(--mono); font-size:13px; font-weight:500;   color:var(--ink-faint);
}
.case-tags{ list-style:none; display:flex; flex-wrap:wrap; gap:8px; }
.case-tags li{
  padding:5px 10px; border:1px solid var(--ink); border-radius:2px;
  font-family:var(--mono); font-size:13px; font-weight:500;   color:var(--ink);
}
figcaption, .case-caption{
  margin-top:14px; font-family:var(--mono); font-size:13px; 
  line-height:1.5; color:var(--ink-faint);
}

/* ---- header ---- */
.case-hero{ position:relative; margin:14px var(--gutter) 0; }
.case-hero-frame{ position:relative; }
.case-hero-media{
  position:relative; overflow:hidden; border-radius:16px;
  aspect-ratio:21/9; background:var(--case-tint);
}
.case-hero-media img{ width:100%; height:100%; object-fit:cover; object-position:70% 55%; }
.case-hero-media::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    linear-gradient(to right,
      color-mix(in srgb, var(--case-tint) 96%, transparent) 0%,
      color-mix(in srgb, var(--case-tint) 90%, transparent) 30%,
      color-mix(in srgb, var(--case-tint) 55%, transparent) 40%,
      transparent 52%);
}
.case-hero-text{
  position:absolute; z-index:1; left:0; top:0; bottom:0;
  width:min(46%, 560px);
  display:flex; flex-direction:column; justify-content:center; gap:18px;
  padding:clamp(24px,4vw,56px);
}
.case-title{
  font-family:var(--serif); font-weight:400; letter-spacing:-.8px;
  font-size:clamp(34px,4.4vw,58px); line-height:1.05; color:var(--ink);
}
.case-title .hl{ color:var(--case-text); }
.case-role{ font-size:16px; color:var(--ink); }

/* ---- shell: side guide + main column ---- */
.case-shell{
  max-width:var(--shell); margin:0 auto; padding:0 var(--gutter);
  display:grid; grid-template-columns:1fr; gap:56px;
}
@media (min-width:1100px){
  .case-shell{ grid-template-columns:190px minmax(0,1fr); }
}
.case-guide{ display:none; }
@media (min-width:1100px){
  .case-guide{ display:block; position:sticky; top:92px; align-self:start; padding-top:64px; }
}
.case-guide-list{ list-style:none; border-left:1px solid var(--line); }
.case-guide-list a{
  display:block; padding:9px 0 9px 16px; margin-left:-1px; min-height:44px;
  border-left:2px solid transparent;
  font-size:14px; line-height:1.4; color:var(--ink-dim); text-decoration:none;
  transition:color .25s ease, border-color .25s ease;
}
.case-guide-list a:hover{ color:var(--ink); }
.case-guide-list a[aria-current="true"]{ color:var(--case-text); border-left-color:var(--case); font-weight:500; }

/* phones: progress line + Sections button */
.case-progress{
  position:fixed; left:0; top:0; height:3px; width:100%; z-index:210; /* above the header */
  background:var(--ink); transform-origin:left center; transform:scaleX(0);
}
.case-sections-btn{
  position:fixed; right:16px; bottom:16px; z-index:50;
  min-height:44px; padding:0 18px; border-radius:999px;
  border:1px solid var(--ink); background:var(--bg); color:var(--ink);
  font-family:var(--mono); font-size:13px; font-weight:500;  
  box-shadow:0 8px 24px -10px rgba(17,17,17,.35); cursor:pointer;
}
.case-sections-panel{
  position:fixed; right:16px; bottom:72px; z-index:50;
  width:min(300px, calc(100vw - 32px)); padding:10px 8px;
  background:var(--surface); border:1px solid var(--line); border-radius:14px;
  box-shadow:0 18px 40px -16px rgba(17,17,17,.4);
}
.case-sections-panel[hidden]{ display:none; }
.case-sections-panel a{
  display:flex; align-items:center; min-height:44px; padding:0 12px; border-radius:8px;
  color:var(--ink); text-decoration:none; font-size:15px;
}
.case-sections-panel a[aria-current="true"]{ color:var(--case-text); font-weight:500; background:var(--case-tint); }
@media (min-width:1100px){
  .case-progress, .case-sections-btn, .case-sections-panel{ display:none !important; }
}

/* ---- sections + rhythm ---- */
.case-main{ min-width:0; padding-bottom:96px; }
.case-sec{ padding:clamp(56px,8vw,104px) 0 0; }
.case-sec > * + *{ margin-top:22px; }
.case-tinted{
  background:var(--case-tint); border-radius:18px;
  padding:clamp(28px,4.5vw,56px); margin-top:clamp(56px,8vw,104px);
}
.case-h2{
  font-family:var(--serif); font-weight:400; letter-spacing:-.5px;
  font-size:clamp(26px,3vw,38px); line-height:1.15; color:var(--ink);
}
.case-h3{
  font-family:var(--serif); font-weight:400; letter-spacing:-.3px;
  font-size:clamp(21px,2.2vw,26px); line-height:1.25; color:var(--ink);
}
.prose{ max-width:var(--measure); }
.prose p + p{ margin-top:1em; }
.prose strong{ font-weight:600; }
.hl{ color:var(--case-text); }
.sketch-underline{
  display:block; width:min(180px,50%); height:12px; margin-top:6px; overflow:visible;
}
.sketch-underline path{ fill:none; stroke:var(--case); stroke-width:2.4; stroke-linecap:round; vector-effect:non-scaling-stroke; }

/* layout A: text left, visual right (phones: visual first) */
.split{ display:grid; gap:clamp(28px,4vw,56px); align-items:center; }
@media (min-width:900px){
  .split{ grid-template-columns:minmax(0,1.05fr) minmax(0,1fr); }
}
@media (max-width:899px){
  .split > .split-visual{ order:-1; }
}

/* ---- At a glance ---- */
.glance{ display:grid; gap:12px; grid-template-columns:1fr; }
@media (min-width:640px){ .glance{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:1000px){ .glance{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
.glance-box{
  background:var(--surface); border:1px solid var(--line); border-radius:12px;
  padding:16px 18px 18px; border-top:3px solid var(--case);
}
.glance-box dt{ font-family:var(--mono); font-size:13px; font-weight:500;   color:var(--case-text); }
.glance-box dd{ margin-top:6px; font-size:15px; line-height:1.5; color:var(--ink); }
.in-short{ font-size:clamp(18px,1.6vw,20px); line-height:1.6; }
.in-short b{ font-weight:600; color:var(--case-text); }

/* ---- hand-drawn diagrams (intro, LivestockAI) ---- */
.sketch{ width:100%; height:auto; overflow:visible; }
.sketch .ln{ fill:none; stroke:var(--ink-dim); stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.sketch .ln-case{ fill:none; stroke:var(--case); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; vector-effect:non-scaling-stroke; }
.sketch .fill-case{ fill:var(--case); }
.sketch .fill-tint{ fill:var(--case-tint); }
.sketch .fill-surface{ fill:var(--surface); }
.sketch text{ font-family:var(--sans); font-size:15px; fill:var(--ink); }
.sketch .t-mono{ font-family:var(--mono); font-size:13px;  fill:var(--ink-faint); }
.sketch .t-hand{ font-family:var(--hand); font-size:22px; fill:var(--ink); }   /* readable on the tint; the strokes carry the green */
.sketch .t-strong{ font-weight:600; }

/* drawn-in once on scroll */
.draw .ln, .draw .ln-case{ stroke-dasharray:1 2; stroke-dashoffset:1; transition:stroke-dashoffset 1.2s cubic-bezier(.45,0,.3,1); }
.draw.is-in .ln, .draw.is-in .ln-case{ stroke-dashoffset:0; }

/* generic reveal: visuals animate in once */
.reveal{ opacity:0; transform:translateY(18px); transition:opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.reveal.is-in{ opacity:1; transform:none; }

/* ---- funnel ---- */
.funnel{ position:relative; }
.funnel-art{ position:relative; padding-top:64px; }
.funnel-steps{ list-style:none; display:grid; gap:0; }
.funnel-step{
  display:grid; grid-template-columns:minmax(0,46%) minmax(0,1fr);
  gap:clamp(20px,3vw,40px); align-items:center;
}
.funnel-bandwrap{ display:flex; justify-content:center; }
.funnel-band{
  position:relative; width:var(--w); min-height:92px;
  display:flex; align-items:center; justify-content:center; gap:10px; text-align:center;
  padding:12px calc(var(--d) + 10px);
  clip-path:polygon(0 0, 100% 0, calc(100% - var(--d)) 100%, var(--d) 100%);
  background:color-mix(in srgb, var(--case-tint) 70%, var(--surface));
  transition:background .6s ease;
}
.funnel-band svg{ position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.funnel-band svg path{ fill:none; stroke:var(--ink-faint); stroke-width:1.5; stroke-linejoin:round; vector-effect:non-scaling-stroke; transition:stroke .6s ease; }
.funnel-num{ font-family:var(--mono); font-size:13px; font-weight:500;  color:var(--ink-faint); transition:color .6s ease; }
.funnel-name{ font-family:var(--serif); font-size:clamp(16px,1.6vw,19px); font-weight:400; line-height:1.2; color:var(--ink); }
.funnel-desc{ font-size:16px; line-height:1.55; color:var(--ink-dim); max-width:46ch; }
.funnel-step.is-lit .funnel-band{ background:var(--case-tint); }
.funnel-step.is-lit .funnel-band svg path{ stroke:var(--case); }
.funnel-step.is-lit .funnel-num{ color:var(--ink); }   /* small text: green on the tint is only 4.4 */
.funnel-dots{ position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.funnel-dots i{
  position:absolute; left:0; top:0; width:8px; height:8px; margin:-4px 0 0 -4px; border-radius:50%;
  background:var(--case); opacity:.55; will-change:transform, opacity;
}
.funnel-out{
  display:grid; grid-template-columns:minmax(0,46%) minmax(0,1fr); gap:clamp(20px,3vw,40px);
  margin-top:18px; align-items:center;
}
.funnel-out-inner{ display:flex; flex-direction:column; align-items:center; gap:10px; }
.funnel-final{
  width:22px; height:22px; border-radius:50%; background:var(--case);
  transform:scale(.3); opacity:0; transition:transform .6s cubic-bezier(.34,1.56,.64,1), opacity .4s ease;
}
.funnel-final-label{ font-family:var(--hand); font-size:24px; color:var(--case-text); opacity:0; transition:opacity .5s ease .15s; }
.funnel.is-done .funnel-final{ transform:none; opacity:1; }
.funnel.is-done .funnel-final-label{ opacity:1; }
@media (max-width:760px){
  .funnel-step, .funnel-out{ grid-template-columns:1fr; gap:10px; }
  .funnel-step{ margin-bottom:22px; }
  .funnel-desc{ max-width:none; text-align:center; margin:0 auto; }
  .funnel-band{ min-height:80px; }
}

/* ---- chapter openers ---- */
.chapter{
  background:var(--case-tint); border-radius:18px;
  padding:clamp(36px,6vw,80px) clamp(24px,5vw,64px);
  margin-top:clamp(72px,10vw,128px);
}
.chapter-num{ font-family:var(--serif); font-size:clamp(56px,9vw,112px); font-weight:400; line-height:1; color:var(--case-text); }
.chapter-title{ margin-top:18px; font-family:var(--serif); font-weight:400; letter-spacing:-.6px; font-size:clamp(28px,3.6vw,46px); line-height:1.1; max-width:22ch; }
.chapter-lead{ margin-top:18px; font-size:clamp(17px,1.5vw,19px); max-width:var(--measure); }
.my-part{
  display:block; margin-top:22px; max-width:var(--measure);
  font-family:var(--mono); font-size:13px; line-height:1.6;  color:var(--ink-dim);
}

/* ---- statement ---- */
.statement{
  padding:clamp(64px,9vw,120px) 0 clamp(20px,3vw,32px);
  font-family:var(--serif); font-weight:400; letter-spacing:-.8px;
  font-size:clamp(30px,4.4vw,56px); line-height:1.12; max-width:20ch;
}
.statement .hl{ color:var(--case-text); }
.statement-sub{ max-width:var(--measure); font-size:18px; color:var(--ink-dim); }

/* ---- interactive prototype ---- */
.proto{
  position:relative; background:var(--case-tint); border-radius:18px;
  padding:clamp(28px,4vw,56px) clamp(16px,4vw,56px) clamp(24px,3vw,40px);
  margin-top:clamp(40px,6vw,72px);
}
.proto-label{ display:block; text-align:center; }
.proto-stage{ position:relative; display:flex; justify-content:center; margin-top:18px; }
.phone{
  width:min(360px, 100%); border-radius:40px; padding:12px;
  background:var(--ink); box-shadow:0 30px 60px -28px rgba(17,17,17,.55);
}
.phone-screen{ border-radius:30px; overflow:hidden; background:var(--bg); display:flex; flex-direction:column; height:560px; }
.phone-head{
  display:flex; align-items:center; gap:10px; padding:14px 16px;
  background:var(--case-tint); border-bottom:1px solid var(--line);
}
.phone-avatar{ width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:var(--surface); font-size:18px; }
.phone-head b{ display:block; font-size:14px; font-weight:600; line-height:1.2; }
.phone-head span{ display:block; font-size:12px; color:var(--ink-dim); }
.phone-body{
  flex:1; overflow-y:auto; padding:16px 14px; display:flex; flex-direction:column; gap:10px;
  scroll-behavior:smooth;
}
.bubble{
  max-width:84%; padding:9px 12px 7px; border-radius:14px; font-size:14.5px; line-height:1.45;
  animation:bubble-in .35s cubic-bezier(.22,1,.36,1) both;
}
.bubble ul{ margin:6px 0 0 18px; }
.bubble li + li{ margin-top:2px; }
.bubble.out{ align-self:flex-end; background:var(--case-tint); border:1px solid color-mix(in srgb, var(--case) 35%, transparent); border-bottom-right-radius:4px; }
.bubble.in{ align-self:flex-start; background:var(--surface); border:1px solid var(--line); border-bottom-left-radius:4px; }
.bubble .meta{ display:block; margin-top:3px; text-align:right; font-size:11px; color:var(--ink-faint); }
.bubble .tick{ color:var(--ink-dim); letter-spacing:-2px; margin-left:2px; }
@keyframes bubble-in{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
.typing{ align-self:flex-start; display:flex; gap:5px; padding:12px 14px; background:var(--surface); border:1px solid var(--line); border-radius:14px; }
.typing i{ width:7px; height:7px; border-radius:50%; background:var(--case); opacity:.35; animation:typing .9s ease-in-out infinite; }
.typing i:nth-child(2){ animation-delay:.15s; } .typing i:nth-child(3){ animation-delay:.3s; }
@keyframes typing{ 0%,100%{ opacity:.35; transform:none; } 40%{ opacity:1; transform:translateY(-3px); } }
.phone-foot{ padding:10px 12px 14px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:8px; }
.suggest{
  min-height:44px; padding:10px 14px; border-radius:14px; text-align:left; cursor:pointer;
  border:1px dashed var(--case); background:var(--surface); color:var(--ink);
  font:inherit; font-size:14px; line-height:1.4;
}
.suggest:hover{ background:var(--case-tint); }
.suggest-hint{ font-family:var(--mono); font-size:13px;   color:var(--ink-faint); }
.proto-replay{
  min-height:44px; padding:0 18px; border-radius:999px; cursor:pointer;
  border:1px solid var(--ink); background:transparent; color:var(--ink);
  font-family:var(--mono); font-size:13px;  
}
.proto-actions{ display:flex; justify-content:center; margin-top:18px; }
.proto-actions [hidden]{ display:none; }
.annot{
  position:absolute; font-family:var(--hand); font-size:24px; line-height:1.1; color:var(--ink);
  display:flex; align-items:center; gap:6px; pointer-events:none;
}
.annot svg{ width:70px; height:40px; overflow:visible; }
.annot svg path{ fill:none; stroke:var(--case); stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.annot--ask{ right:calc(50% + 200px); bottom:110px; }
.annot--answer{ left:calc(50% + 200px); top:150px; }
@media (max-width:899px){
  .annot{ position:static; justify-content:center; margin:6px 0; }
  .annot svg{ width:40px; height:28px; }
  .proto-stage{ flex-direction:column; align-items:center; }
  .annot--answer{ order:-1; }
  .phone-screen{ height:520px; }
}

/* ---- forms (page-turning cards) ---- */
.forms{ display:grid; gap:18px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.form-card{
  position:relative; aspect-ratio:3/4; border-radius:6px; background:var(--surface);
  border:1px solid var(--line); box-shadow:4px 6px 0 -1px var(--bg-raised), 4px 6px 0 0 var(--line), 0 16px 30px -18px rgba(17,17,17,.35);
  display:flex; flex-direction:column; justify-content:space-between; padding:16px;
  transition:transform .4s cubic-bezier(.22,1,.36,1);
}
.form-card:nth-child(1){ transform:rotate(-2deg); }
.form-card:nth-child(2){ transform:rotate(1.5deg); }
.form-card::after{   /* folded page corner */
  content:""; position:absolute; right:0; bottom:0; width:26px; height:26px;
  background:linear-gradient(135deg, var(--bg-raised) 50%, var(--line) 50%);
  border-top-left-radius:4px;
}
.form-name{ font-family:var(--serif); font-size:18px; font-weight:400; line-height:1.2; }
.form-slot{
  font-family:var(--mono); font-size:13px; line-height:1.5;  color:var(--ink-dim);
  border:1px dashed var(--ink-faint); border-radius:4px; padding:10px; text-align:center;
}

/* ---- findings ---- */
.findings{ list-style:none; display:grid; gap:12px; max-width:var(--measure); }
.findings li{
  position:relative; padding:14px 18px 14px 46px; background:var(--surface);
  border:1px solid var(--line); border-radius:12px; font-size:16.5px; line-height:1.55;
}
.findings li svg{ position:absolute; left:16px; top:18px; width:18px; height:18px; overflow:visible; }
.findings li svg path{ fill:none; stroke:var(--case); stroke-width:2.2; stroke-linecap:round; }

/* ---- three days strip ---- */
.days{ margin-top:8px; }
.days-art{ position:relative; }
.days-labels{ display:grid; grid-template-columns:repeat(3,1fr); text-align:center; margin-top:6px; }
.days-labels b{ display:block; font-family:var(--serif); font-size:clamp(18px,2vw,24px); font-weight:400; }
.days-labels span{ display:block; font-family:var(--mono); font-size:13px;   color:var(--ink-faint); }
.day-list{ list-style:none; display:grid; gap:12px; max-width:var(--measure); }
.day-list li{ padding-left:18px; border-left:2px solid var(--case); }
.day-list b{ font-weight:600; }

/* ---- next case study card (same recipe as the homepage cards) ---- */
.next-card{
  position:relative; display:block; overflow:hidden; border-radius:12px;
  aspect-ratio:2000/1131; margin-top:clamp(56px,8vw,96px);
  background:var(--nc-tint);
  box-shadow:0 1px 2px rgba(17,17,17,.05), 0 10px 30px -14px rgba(17,17,17,.18);
  transition:translate .45s cubic-bezier(.22,1,.36,1), box-shadow .45s ease;
}
.next-card:hover, .next-card:focus-within{ translate:0 -6px; box-shadow:0 2px 4px rgba(17,17,17,.06), 0 22px 44px -16px rgba(17,17,17,.26); }
.next-card--xymbia{ --nc:var(--cs-xymbia); --nc-tint:var(--cs-xymbia-tint); }
.next-card img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.next-card::before{
  content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background:
    linear-gradient(to right,
      color-mix(in srgb, var(--nc-tint) 97%, transparent) 0%,
      color-mix(in srgb, var(--nc-tint) 93%, transparent) 26%,
      color-mix(in srgb, var(--nc-tint) 60%, transparent) 34%,
      transparent 43%),
    linear-gradient(to top, color-mix(in srgb, var(--nc-tint) 78%, transparent) 0%, transparent 22%);
}
.next-text{ position:absolute; z-index:2; left:0; bottom:0; width:min(40%,460px); padding:clamp(22px,3.4vw,46px); }
.next-text .case-label{ color:var(--ink-dim); }
.next-title{ margin:8px 0 10px; font-family:var(--serif); font-weight:400; font-size:clamp(30px,3.6vw,46px); line-height:1.05; letter-spacing:-.5px; color:var(--nc); }
.next-desc{ font-size:16px; line-height:1.45; margin-bottom:14px; }
.next-text .case-tags{ margin-bottom:18px; }
.next-note{ margin-top:12px; font-family:var(--mono); font-size:13px;  color:var(--ink-dim); }
.next-soon{ font-family:var(--mono); font-size:13px;   }

/* black button with a small arrow */
.btn-black{
  display:inline-flex; align-items:center; gap:10px; min-height:44px;
  padding:11px 20px; border-radius:6px; border:0;
  background:var(--ink); color:var(--bg); font-size:15px; font-weight:500; text-decoration:none; cursor:pointer;
}
.btn-black:hover{ color:var(--bg); }
.btn-black span{ transition:transform .3s cubic-bezier(.22,1,.36,1); }
.btn-black:hover span, .next-card:hover .btn-black span{ transform:translateX(3px); }
.next-card .btn-black::after{ content:""; position:absolute; inset:0; z-index:3; }
.case-end{ margin-top:40px; }

@media (max-width:760px){
  .case-hero-media{ aspect-ratio:16/10; }
  .case-hero-media::after{ background:linear-gradient(to top, color-mix(in srgb, var(--case-tint) 60%, transparent) 0%, transparent 25%); }
  .case-hero-text{ position:static; width:auto; padding:22px 0 0; }
  .next-card{ aspect-ratio:auto; display:flex; flex-direction:column; }
  .next-card img{ position:static; aspect-ratio:2000/1131; height:auto; }
  .next-card::before{ content:none; }
  .next-text{ position:static; width:auto; padding:20px; }
  .forms{ grid-template-columns:1fr; max-width:320px; margin-inline:auto; }
}

/* ---- animations switched off: everything final, nothing moves ---- */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *, *::before, *::after{ animation:none !important; transition:none !important; }
  .reveal{ opacity:1; transform:none; }
  .draw .ln, .draw .ln-case{ stroke-dashoffset:0; }
  .funnel-final, .funnel-final-label{ opacity:1; transform:none; }
  .next-card:hover, .next-card:focus-within{ translate:none; }
  .phone-body{ scroll-behavior:auto; }
}

/* ============================================================
   Added 2026-10-05 for the Xymbia page (reusable by every case page)
   ============================================================ */

/* ---- review marks: "[TO CONFIRM: ...]" and "Draft: review" ---- */
.tbc{
  display:inline; padding:1px 6px; border-radius:4px;
  background:var(--wash-amber); color:var(--ink);
  box-decoration-break:clone; -webkit-box-decoration-break:clone;
  font-family:var(--mono); font-size:.82em;  outline:1px dashed var(--amber);
}
.draft{
  display:inline-block; vertical-align:.12em; margin-left:6px; padding:1px 6px; border-radius:999px;
  background:var(--wash-amber); color:var(--ink); border:1px solid var(--amber);
  font-family:var(--mono); font-size:13px; font-weight:500;  line-height:1.5; white-space:nowrap;
}

/* ---- header variant: real screens instead of a photo ---- */
.case-hero--screens .case-hero-media{ aspect-ratio:auto; min-height:clamp(440px,42vw,580px); }
.case-hero--screens .case-hero-media::after{ content:none; }
.hero-phones{
  position:absolute; right:clamp(16px,4vw,56px); top:50%; transform:translateY(-50%);
  display:flex; gap:clamp(10px,1.6vw,22px); align-items:center;
}
.hero-phones .shot{ width:clamp(120px,13vw,190px); }
.hero-phones .shot:nth-child(2){ transform:translateY(-22px); }
@media (max-width:760px){
  .case-hero--screens .case-hero-media{ min-height:0; padding:22px 0 26px; }
  .hero-phones{ position:static; transform:none; justify-content:center; }
  .hero-phones .shot{ width:28vw; }
}

/* ---- a phone screenshot (real Figma frame) ---- */
.shot{
  position:relative; border-radius:22px; overflow:hidden; background:var(--surface);
  border:6px solid var(--ink); box-shadow:0 18px 40px -22px rgba(17,17,17,.5);
}
.shot img{ width:100%; height:auto; display:block; }

/* ---- horizontal strip of screens with step labels ---- */
.strip{
  list-style:none; display:grid; grid-auto-flow:column; grid-auto-columns:clamp(170px,22vw,220px);
  gap:18px; overflow-x:auto; padding:6px 4px 18px; scroll-snap-type:x mandatory; scrollbar-width:thin;
}
.strip li{ scroll-snap-align:start; }
/* fading edges (2026-10-06): the row melts out at the sides instead of being cut off */
.strip, .ct:not(.is-ready) .ct-frames{
  -webkit-mask-image:linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 48px), transparent 100%);
          mask-image:linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 48px), transparent 100%);
}
.strip-step{ display:block; margin-top:10px; font-family:var(--mono); font-size:13px;   color:var(--ink-faint); }
.strip-name{ display:block; font-size:14px; line-height:1.4; color:var(--ink); }
.strip:focus-visible{ outline:2px solid var(--ink); outline-offset:4px; border-radius:8px; }
.strip-hint{ font-family:var(--mono); font-size:13px;  color:var(--ink-faint); }

/* ---- side-by-side screens ---- */
.pair{ display:grid; gap:22px; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; max-width:560px; }
@media (max-width:520px){ .pair{ grid-template-columns:1fr; max-width:300px; margin-inline:auto; } }

/* ---- glossary cards ---- */
.terms{ list-style:none; display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); }
.terms li{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px 18px; }
.terms dfn{ display:block; font-style:normal; font-family:var(--serif); font-size:19px; font-weight:400; color:var(--case-text); margin-bottom:4px; }
.terms p{ font-size:15px; line-height:1.55; }

/* ---- archetype cards ---- */
.archetypes{ display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)); }
.arch{ background:var(--surface); border:1px solid var(--line); border-top:3px solid var(--case); border-radius:12px; padding:18px 18px 20px; }
.arch h4{ font-family:var(--serif); font-size:22px; font-weight:400; }
.arch .arch-desc{ margin-top:6px; font-size:15px; line-height:1.55; color:var(--ink-dim); }
.arch dt{ font-family:var(--mono); font-size:13px; font-weight:500;   color:var(--ink-faint); margin-top:14px; }
.arch dd{ font-size:14.5px; line-height:1.55; margin-top:4px; }

/* ---- rules panel (verbatim written rules) ---- */
.rules{ display:grid; gap:14px; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); }
.rule{ background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:16px 18px; }
.rule b{ display:inline-block; margin-bottom:6px; padding:2px 10px; border-radius:999px; background:var(--case-tint); color:var(--ink); font-size:13px; font-weight:600; }
.rule p{ font-size:15px; line-height:1.55; }
.rule ul{ margin:6px 0 0 18px; font-size:15px; line-height:1.55; }

/* ---- sticky notes (open questions) ---- */
.stickies{ display:flex; flex-wrap:wrap; gap:20px; }
.sticky{
  width:min(100%,290px); padding:18px 18px 22px; background:var(--wash-amber);
  border:1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  box-shadow:0 10px 22px -16px rgba(17,17,17,.45);
  font-family:var(--hand); font-size:23px; line-height:1.2; color:var(--ink);
}
.sticky:nth-child(odd){ transform:rotate(-1.5deg); }
.sticky:nth-child(even){ transform:rotate(1.2deg); }
.sticky small{ display:block; margin-bottom:6px; font-family:var(--mono); font-size:13px;   color:var(--ink-dim); }

/* ---- simple redrawn flow (boxes + arrows) ---- */
.flow{ list-style:none; display:flex; flex-wrap:wrap; align-items:center; gap:10px 0; }
.flow li{ display:flex; align-items:center; }
.flow li + li::before{ content:"\2192"; margin:0 10px; color:var(--case); font-weight:600; }
.flow span{ padding:8px 12px; border:1.5px solid var(--case); border-radius:10px; background:var(--surface); font-size:14.5px; line-height:1.35; }
.flow .is-end span{ background:var(--case-tint); font-weight:600; }
.flow-label{ display:block; margin:18px 0 8px; font-family:var(--mono); font-size:13px;   color:var(--ink-faint); }

/* ---- click-through prototype of real screens ---- */
.ct{ background:var(--case-tint); border-radius:18px; padding:clamp(24px,4vw,48px) clamp(16px,4vw,48px); margin-top:clamp(40px,6vw,72px); }
.ct-label{ display:block; text-align:center; }
.ct-stage{ display:flex; justify-content:center; margin-top:16px; }
.ct-phone{ position:relative; width:min(300px,78vw); }
.ct-frames{ list-style:none; }
.ct.is-ready .ct-frames li{ display:none; }
.ct.is-ready .ct-frames li.is-current{ display:block; }
.ct-hot{
  position:absolute; width:36%; height:7%; transform:translate(-50%,-50%);
  border:2px dashed var(--case); border-radius:999px; background:color-mix(in srgb, var(--case) 10%, transparent);
  cursor:pointer; animation:ct-pulse 1.6s ease-in-out infinite;
}
@keyframes ct-pulse{ 0%,100%{ box-shadow:0 0 0 0 color-mix(in srgb, var(--case) 35%, transparent); } 50%{ box-shadow:0 0 0 8px transparent; } }
.ct-bar{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:10px 14px; margin-top:18px; }
.ct-bar button{
  min-height:44px; padding:0 18px; border-radius:999px; cursor:pointer;
  border:1px solid var(--ink); background:var(--surface); color:var(--ink); font:inherit; font-size:14px;
}
.ct-bar button[disabled]{ opacity:.4; cursor:default; }
.ct-bar .ct-next{ background:var(--ink); color:var(--bg); }
.ct-status{ min-width:220px; text-align:center; font-family:var(--mono); font-size:13px;  color:var(--ink); }
/* without JavaScript the frames show as a scrolling strip */
.ct:not(.is-ready) .ct-frames{ display:grid; grid-auto-flow:column; grid-auto-columns:200px; gap:14px; overflow-x:auto; }
.ct:not(.is-ready) .ct-phone{ width:100%; }
.ct:not(.is-ready) .ct-bar, .ct:not(.is-ready) .ct-hot{ display:none; }

/* ---- wide images (task cards, multi-screen frames) ---- */
.wide-img{ border-radius:12px; overflow:hidden; border:1px solid var(--line); background:var(--surface); }
.wide-img img{ width:100%; height:auto; }
.task-cards{ display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr)); }

/* ---- roadmap of phases ---- */
.phases{ list-style:none; display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr)); counter-reset:ph; }
.phases li{ padding:16px 16px 18px; background:var(--surface); border:1px solid var(--line); border-radius:12px; counter-increment:ph; }
.phases li::before{ content:counter(ph, decimal-leading-zero); display:block; font-family:var(--mono); font-size:13px; color:var(--ink-faint); margin-bottom:4px; }
.phases b{ display:block; font-family:var(--serif); font-size:18px; font-weight:400; line-height:1.25; }

.next-card--marham{ --nc:var(--cs-marham); --nc-tint:var(--cs-marham-tint); }

@media (prefers-reduced-motion: reduce){
  .ct-hot{ animation:none; }
  .sticky{ transform:none !important; }
}

/* ============================================================
   Editorial components (2026-10-06, Xymbia rebuild; reusable).
   Quieter than the first pass: hairline rules instead of tinted
   boxes, large serif display, real images doing the work.
   ============================================================ */

/* ---- header: title first, then one wide real image ---- */
.ed-hero{ max-width:var(--shell); margin:28px auto 0; padding:0 var(--gutter); }
.ed-hero-text{ display:grid; gap:22px; max-width:900px; padding:clamp(24px,5vw,72px) 0 clamp(28px,4vw,48px); }
.ed-title{
  font-family:var(--serif); font-weight:400; letter-spacing:-.025em;
  font-size:clamp(40px,6.4vw,84px); line-height:1.02; text-wrap:balance; color:var(--ink);
}
.ed-title .hl{ color:var(--case-text); }
.ed-lead{ font-size:clamp(18px,1.6vw,21px); line-height:1.55; color:var(--ink-dim); max-width:60ch; }
.ed-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:12px 22px; font-size:15px; color:var(--ink-dim); }
.ed-meta .case-tags li{ border-color:var(--line); color:var(--ink-dim); font-size:13px; padding:4px 10px; border-radius:999px; }
.ed-hero-media{ border-radius:20px; background:var(--case-tint); padding:clamp(18px,3vw,40px); overflow:hidden; }
.ed-hero-media img{ width:100%; height:auto; border-radius:10px; }

/* ---- chapter opener: big serif number, title, one fine rule ---- */
.opener{
  display:grid; grid-template-columns:auto minmax(0,1fr); gap:clamp(18px,3vw,40px); align-items:start;
  padding-top:clamp(40px,6vw,64px); margin-top:clamp(72px,10vw,136px); border-top:1px solid var(--line);
}
.opener-num{ font-family:var(--serif); font-weight:400; font-size:clamp(44px,6vw,80px); line-height:.9; color:var(--case-text); font-variant-numeric:lining-nums; }
.opener h2{ font-family:var(--serif); font-weight:400; letter-spacing:-.02em; font-size:clamp(30px,3.8vw,50px); line-height:1.06; text-wrap:balance; }
.opener p{ margin-top:16px; font-size:clamp(17px,1.4vw,19px); line-height:1.6; color:var(--ink-dim); max-width:60ch; }
@media (max-width:560px){ .opener{ grid-template-columns:1fr; gap:10px; } }

.ed-sec{ margin-top:clamp(48px,6vw,80px); }
.ed-sec > * + *{ margin-top:20px; }
.ed-h3{ font-family:var(--serif); font-weight:400; letter-spacing:-.01em; font-size:clamp(23px,2.2vw,30px); line-height:1.18; text-wrap:balance; }
.ed-body{ max-width:var(--measure); font-size:17.5px; line-height:1.7; }
.ed-body p + p{ margin-top:1em; }
.ed-small{ font-size:14px; color:var(--ink-faint); }

/* pull quote from the files */
.ed-quote{ max-width:30ch; font-family:var(--serif); font-weight:400; font-size:clamp(26px,3vw,38px); line-height:1.16; letter-spacing:-.015em; text-wrap:balance; }
.ed-quote cite{ display:block; margin-top:14px; font-family:var(--sans); font-size:14px; font-weight:400; color:var(--ink-faint); }

/* quotes in a row (pain points) */
.voices{ display:grid; gap:0; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); border-top:1px solid var(--line); }
.voices figure{ padding:22px 22px 22px 0; border-bottom:1px solid var(--line); }
.voices blockquote{ font-size:17px; line-height:1.5; }
.voices figcaption{ margin-top:10px; font-size:13.5px; color:var(--ink-faint); font-family:var(--sans); letter-spacing:0; }

/* figures */
.ed-figure img{ width:100%; height:auto; border-radius:12px; }
.ed-figure figcaption{ font-family:var(--sans); letter-spacing:0; font-size:14px; }
.ed-two{ display:grid; gap:clamp(24px,4vw,56px); grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); align-items:center; }
.ed-board{ background:var(--bg-raised); border-radius:18px; padding:clamp(18px,3vw,36px); }
.ed-board img{ border-radius:10px; box-shadow:0 1px 2px rgba(17,17,17,.06); }
.phone-row{ display:flex; gap:clamp(12px,2vw,24px); justify-content:center; flex-wrap:wrap; }
.phone-row .shot{ width:min(220px,42vw); }
.shot--device{ border-radius:26px; border:6px solid var(--ink); }

/* ---- persona cards, as rich as the originals ---- */
.personas{ display:grid; gap:20px; grid-template-columns:repeat(auto-fit,minmax(min(100%,460px),1fr)); }
.pcard{ background:var(--surface); border:1px solid var(--line); border-radius:16px; overflow:hidden; }
.pcard-head{ display:flex; gap:16px; align-items:flex-start; padding:24px 26px 20px; border-bottom:1px solid var(--line-soft); }
.pcard-mono{ flex:none; width:52px; height:52px; border-radius:50%; display:grid; place-items:center; background:var(--case-tint); color:var(--case-text); font-family:var(--serif); font-size:24px; }
.pcard-head h3{ font-family:var(--serif); font-weight:400; font-size:28px; line-height:1.1; }
.pcard-head p{ margin-top:6px; font-size:15px; line-height:1.5; color:var(--ink-dim); }
.pcard-body{ display:grid; grid-template-columns:1fr 1fr; }
.pcard-col{ padding:20px 26px 24px; display:flex; flex-direction:column; gap:8px; }
.pcard-col + .pcard-col{ border-left:1px solid var(--line-soft); }
.pcard-col h4{ font-size:13px; font-weight:600; color:var(--ink-faint); margin-top:10px; }
.pcard-col h4:first-child{ margin-top:0; }
.pcard-col ul{ list-style:none; display:flex; flex-direction:column; gap:7px; font-size:14.5px; line-height:1.45; }
.pcard-col li{ padding-left:12px; border-left:2px solid var(--line); }
.pcard-apps{ font-size:14px; line-height:1.5; color:var(--ink-dim); }
.pcard-profile{ display:grid; gap:7px; }
.pcard-row{ display:grid; grid-template-columns:118px 1fr; align-items:center; font-size:13.5px; color:var(--ink-dim); }
.pips{ display:flex; gap:4px; }
.pips i{ width:20px; height:6px; border-radius:3px; background:var(--line); }
.pips i.on{ background:var(--case); }
.pcard-row.is-key{ color:var(--ink); font-weight:600; }
@media (max-width:620px){
  .pcard-body{ grid-template-columns:1fr; }
  .pcard-col + .pcard-col{ border-left:0; border-top:1px solid var(--line-soft); }
}

/* ---- headline numbers ---- */
.stats{ display:grid; gap:0; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.stat{ padding:26px 24px 24px 0; }
.stat + .stat{ padding-left:24px; border-left:1px solid var(--line); }
@media (max-width:520px){ .stat + .stat{ padding-left:0; border-left:0; border-top:1px solid var(--line); } }
.stat b{ display:block; font-family:var(--serif); font-weight:400; font-size:clamp(44px,5vw,64px); line-height:1; letter-spacing:-.02em; font-variant-numeric:lining-nums tabular-nums; }
.stat span{ display:block; margin-top:10px; font-size:15px; color:var(--ink); }
.stat small{ display:block; margin-top:4px; font-size:13.5px; color:var(--ink-faint); }

/* ---- bar chart: average rating per task (single series) ---- */
.chart{ background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:clamp(18px,3vw,32px); }
.chart-title{ font-size:16px; font-weight:600; }
.chart-sub{ font-size:14px; color:var(--ink-faint); margin-top:2px; }
.chart-group{ margin-top:18px; font-size:13px; font-weight:600; color:var(--ink-faint); }
.bars{ list-style:none; margin-top:8px; display:grid; gap:4px; }
.bar{ position:relative; display:grid; grid-template-columns:minmax(120px,240px) 1fr; gap:14px; align-items:center; min-height:34px; border-radius:6px; outline:none; }
.bar-label{ font-size:14.5px; line-height:1.3; }
.bar-track{ position:relative; height:22px; }
.bar-track::before{ /* target line at 4.0 / 5 */
  content:""; position:absolute; top:-6px; bottom:-6px; left:80%; border-left:1.5px dashed var(--ink-faint); z-index:1;
}
.bar-fill{ position:absolute; left:0; top:3px; height:16px; width:calc(var(--v) / 5 * 100%); background:var(--case); border-radius:0 4px 4px 0; }
.bar-val{ position:absolute; top:50%; transform:translateY(-50%); left:calc(var(--v) / 5 * 100% + 8px); font-size:13.5px; font-variant-numeric:tabular-nums; color:var(--ink); white-space:nowrap; }
.bar--none .bar-val{ left:0; color:var(--ink-faint); }
.bar-tip{
  position:absolute; z-index:5; right:0; bottom:calc(100% + 6px); min-width:220px;
  background:var(--ink); color:var(--bg); border-radius:8px; padding:10px 12px; font-size:13px; line-height:1.45;
  opacity:0; pointer-events:none; transition:opacity .15s ease;
}
.bar-tip b{ display:block; font-weight:600; margin-bottom:4px; }
.bar:hover .bar-tip, .bar:focus-visible .bar-tip{ opacity:1; }
.bar:hover, .bar:focus-visible{ background:var(--bg-raised); }
.bar:focus-visible{ box-shadow:0 0 0 2px var(--ink); }
.chart-key{ display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:16px; font-size:13px; color:var(--ink-faint); }
.chart-key span{ display:inline-flex; align-items:center; gap:8px; }
.chart-key .k-target{ width:18px; border-top:1.5px dashed var(--ink-faint); }
.chart table{ margin-top:12px; border-collapse:collapse; font-size:14px; width:100%; font-variant-numeric:tabular-nums; }
.chart th, .chart td{ text-align:left; padding:6px 8px; border-bottom:1px solid var(--line-soft); }
.chart summary{ margin-top:14px; cursor:pointer; font-size:14px; min-height:44px; display:flex; align-items:center; }
@media (max-width:560px){ .bar{ grid-template-columns:1fr; gap:4px; } }

/* ---- findings: evidence beside the fix ---- */
.finding{ display:grid; gap:clamp(20px,4vw,56px); grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); align-items:start; padding:clamp(28px,4vw,44px) 0; border-top:1px solid var(--line); }
.finding:last-child{ border-bottom:1px solid var(--line); }
@media (max-width:820px){ .finding{ grid-template-columns:1fr; } .finding > .finding-visual{ order:-1; } }
.finding-score{ display:inline-flex; gap:10px; align-items:baseline; font-size:14px; color:var(--ink-faint); }
.finding-score b{ font-family:var(--serif); font-weight:400; font-size:30px; color:var(--ink); }
.finding h4{ margin-top:8px; font-family:var(--serif); font-weight:400; font-size:clamp(22px,2.2vw,28px); line-height:1.18; }
.finding p{ margin-top:12px; font-size:16.5px; line-height:1.65; max-width:58ch; }
.finding blockquote{ margin-top:14px; padding-left:16px; border-left:2px solid var(--case); font-size:16.5px; line-height:1.55; }
.finding blockquote cite{ display:block; margin-top:6px; font-size:13.5px; color:var(--ink-faint); }
.fix{ margin-top:16px; padding:14px 16px; border-radius:10px; background:var(--case-tint); font-size:15.5px; line-height:1.55; }
.fix b{ display:block; font-size:13px; font-weight:600; margin-bottom:2px; }
.finding-visual{ display:flex; gap:14px; justify-content:center; }
.finding-visual img{ width:min(220px,46%); height:auto; border-radius:18px; border:5px solid var(--ink); }

/* plain ruled lists */
.ruled{ list-style:none; border-top:1px solid var(--line); max-width:var(--measure); }
.ruled li{ padding:14px 0; border-bottom:1px solid var(--line); font-size:16.5px; line-height:1.55; }
.ruled li b{ font-weight:600; }

/* closing reflection */
.reflect{ margin-top:clamp(72px,10vw,136px); padding:clamp(36px,6vw,80px) clamp(24px,5vw,64px); border-radius:20px; background:var(--case-tint); }
.reflect p.ed-quote{ max-width:22ch; }

/* ============================================================
   Marham page pieces (added 2026-10-06; reusable).
   ============================================================ */
.next-card--ds{ --nc:var(--cs-ds); --nc-tint:var(--cs-ds-tint); }

/* a working principle, named once where the evidence is */
.principle{ display:inline-flex; align-items:center; gap:8px; padding:6px 14px; border:1px solid var(--line); border-radius:999px; font-size:14px; color:var(--ink-dim); background:var(--surface); }
.principle b{ font-weight:600; color:var(--ink); }

/* the room: six teams around every decision */
.room{ position:relative; display:grid; gap:12px; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-areas:"a b c" "d m e" ". f ."; max-width:760px; margin-inline:auto; }
.room-core{ grid-area:m; display:grid; place-items:center; text-align:center; aspect-ratio:1; border-radius:50%; background:var(--case-tint); padding:16px; font-family:var(--serif); font-size:clamp(18px,2vw,24px); line-height:1.2; }
.room-list{ display:contents; list-style:none; }
.room-list li{ display:grid; place-items:center; text-align:center; padding:16px 12px; border:1px solid var(--line); border-radius:14px; background:var(--surface); font-size:15.5px; line-height:1.35; }
.room-list li:nth-child(1){ grid-area:a; } .room-list li:nth-child(2){ grid-area:b; } .room-list li:nth-child(3){ grid-area:c; }
.room-list li:nth-child(4){ grid-area:d; } .room-list li:nth-child(5){ grid-area:e; } .room-list li:nth-child(6){ grid-area:f; }
@media (max-width:560px){
  .room{ grid-template-columns:1fr 1fr; grid-template-areas:none; }
  .room-core{ grid-column:1 / -1; aspect-ratio:auto; border-radius:14px; order:-1; }
  .room-list li{ grid-area:auto !important; }
}

/* sketch beside the finished screens */
.evolve{ display:grid; gap:clamp(16px,3vw,32px); grid-template-columns:minmax(0,.55fr) minmax(0,1fr); align-items:center; }
.evolve figure figcaption{ margin-top:10px; font-size:14px; color:var(--ink-faint); }
.evolve img{ width:100%; height:auto; border-radius:12px; border:1px solid var(--line); }
@media (max-width:760px){ .evolve{ grid-template-columns:1fr; } }

/* "what if the doctor is busy?" branching prototype */
.branch{ background:var(--case-tint); border-radius:18px; padding:clamp(24px,4vw,48px) clamp(16px,4vw,48px); }
.br-start{ display:grid; justify-items:center; gap:14px; text-align:center; }
.br-q{ font-family:var(--serif); font-size:clamp(22px,2.4vw,30px); line-height:1.2; }
.br-choices{ display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:6px; }
.br-choices button{ min-height:44px; padding:0 18px; border-radius:999px; border:1px solid var(--ink); background:var(--surface); color:var(--ink); font:inherit; font-size:14.5px; cursor:pointer; }
.br-choices button[aria-pressed="true"]{ background:var(--ink); color:var(--bg); }
.br-choices button:focus-visible{ outline:2px solid var(--ink); outline-offset:3px; }
.br-status{ font-size:14px; color:var(--ink-dim); min-height:1.4em; }
.br-panel{ margin-top:28px; }
.br-panel h3{ font-family:var(--serif); font-weight:400; font-size:22px; text-align:center; }
.br-steps{ list-style:none; display:flex; flex-wrap:wrap; justify-content:center; align-items:stretch; gap:14px 0; margin-top:18px; }
.br-steps > li{ display:flex; align-items:center; }
.br-steps > li + li::before{ content:"\2192"; margin:0 12px; font-size:20px; color:var(--ink-faint); }
.branch.is-ready .br-panel{ display:none; }
.branch.is-ready .br-panel.is-current{ display:block; }
/* a phone-sized card rebuilt from the real screen text */
.qcard{ width:min(250px,76vw); min-height:220px; display:flex; flex-direction:column; gap:10px; padding:20px 18px; border-radius:22px; border:5px solid var(--ink); background:var(--surface); font-size:14.5px; line-height:1.45; text-align:center; }
.qcard-top{ font-size:12.5px; color:var(--ink-faint); }
.qcard b{ font-size:16px; line-height:1.3; }
.qcard .qbtns{ display:flex; gap:8px; justify-content:center; margin-top:auto; flex-wrap:wrap; }
.qcard .qbtn{ padding:6px 12px; border-radius:8px; border:1.5px solid var(--case); font-size:13.5px; font-weight:600; }
.qcard .qbtn.is-main{ background:var(--case); color:#fff; }
.qcard .qtoken{ display:flex; justify-content:space-around; padding:10px 0; border-block:1px solid var(--line-soft); }
.qcard .qtoken span{ display:block; font-size:12.5px; color:var(--ink-faint); }
.qcard .qtoken strong{ font-family:var(--serif); font-weight:400; font-size:26px; }
.qcard .qrow{ display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid var(--line-soft); text-align:left; }
.qcard .qhide{ display:inline-block; padding:0 6px; border-radius:4px; background:var(--line-soft); color:var(--ink-faint); font-size:12.5px; }
@media (max-width:620px){
  .br-steps{ flex-direction:column; align-items:center; }
  .br-steps > li{ flex-direction:column; }
  .br-steps > li + li::before{ content:"\2193"; margin:6px 0; }
}
