/* ---------------------------------------------------------------
   Project intelligence case loop. A stylised recreation of the
   copilot: the question, the four sources it reads, the answer
   with its citations, the tenant edge, and the Monday brief.
   Laid out at a fixed design size of 1440x900 inside .cp-fit,
   which is scaled to the frame width. Only .cp-cam (scale and
   translate) moves for the pushes. Transforms, opacity and
   stroke-dashoffset only. Every colour comes from tokens.css.

   This frame runs near full page width (about 1400px), so the
   type is set larger than the home page loops: anything a viewer
   is meant to read is 20px or more in design space.
   --------------------------------------------------------------- */
.demo[data-demo="case-project"] { background: var(--ink-0); }

.cp-fit {
  position: absolute; top: 0; left: 0; width: 1440px; height: 900px;
  transform-origin: 0 0; background: var(--ink-0);
}
.cp-fit * { box-sizing: border-box; }
.cp-fit p, .cp-fit h4 { margin: 0; }
.cp-fit svg { display: block; }

/* --- the camera and the app ------------------------------------ */
.cp-cam {
  position: absolute; top: 0; left: 0; width: 1440px; height: 900px;
  transform-origin: 0 0; overflow: hidden;
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  font-weight: 400; color: var(--text-on-ink);
  -webkit-font-smoothing: antialiased;
}
.cp-app { position: absolute; inset: 0; background: var(--ink-0); }

/* kicker labels: these are labels, not reading text */
.cp-k {
  font-family: var(--font-display); font-size: 11px; font-weight: 500; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--text-on-ink-faint);
}
.cp-mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--text-on-ink-muted); }
.cp-panel { background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 6px; }

/* rail */
.cp-rail {
  position: absolute; top: 0; left: 0; bottom: 0; width: 208px;
  background: var(--ink-1); border-right: 1px solid var(--ink-line); padding: 26px 0 0;
}
.cp-brand {
  padding: 0 26px; font-family: var(--font-display); font-size: 15px; font-weight: 400;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-on-ink);
}
.cp-brand b { color: var(--accent); font-weight: 400; }
.cp-brand__s { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--text-on-ink-faint); text-transform: none; }
.cp-nav { position: relative; margin-top: 34px; }
.cp-nav__i {
  position: relative; display: flex; align-items: center; height: 44px; padding: 0 26px;
  font-size: 14px; color: var(--text-on-ink-muted);
}
.cp-nav__i em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--text-on-ink-faint); }
.cp-nav__ind {
  position: absolute; left: 0; top: 0; width: 208px; height: 44px;
  background: rgba(233, 230, 223, 0.05); border-left: 2px solid var(--accent); pointer-events: none;
}
.cp-rail__foot {
  position: absolute; left: 26px; right: 26px; bottom: 26px; padding-top: 16px;
  border-top: 1px solid var(--ink-line); font-size: 12px; color: var(--text-on-ink-faint); line-height: 1.7;
}
.cp-rail__foot b { display: block; color: var(--text-on-ink-muted); font-weight: 400; }

/* top bar */
.cp-top {
  position: absolute; top: 0; left: 208px; right: 0; height: 56px;
  display: flex; align-items: center; gap: 18px; padding: 0 36px;
  background: var(--ink-1); border-bottom: 1px solid var(--ink-line);
}
.cp-top__org { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.cp-top__org span { color: var(--text-on-ink-faint); }
.cp-top__tenant {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--text-on-ink-muted); white-space: nowrap;
  border: 1px solid var(--ink-line-strong); border-radius: 999px; padding: 5px 12px 5px 10px;
}
.cp-top__tenant i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cp-avatar {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ink-line-strong);
  display: flex; align-items: center; justify-content: center; flex: none;
  font-family: var(--font-display); font-size: 10px; letter-spacing: 0.06em; color: var(--text-on-ink-muted);
}

/* main: 1232 x 844. Panes stack, each absolutely laid out in main space. */
.cp-main { position: absolute; top: 56px; left: 208px; right: 0; bottom: 0; }
.cp-pane { position: absolute; inset: 0; opacity: 0; }

/* ---------- Ask ---------- */
.cp-composer {
  position: absolute; left: 116px; top: 40px; width: 1000px; height: 96px;
  display: flex; align-items: center; gap: 24px; padding: 0 24px 0 28px;
  background: var(--ink-2); border: 1px solid var(--ink-line-strong); border-radius: 6px;
}
.cp-composer__q { flex: 1; min-width: 0; font-size: 23px; line-height: 1.35; color: var(--text-on-ink); white-space: nowrap; overflow: hidden; }
.cp-composer__q .cp-k { display: block; margin-bottom: 4px; }
.cp-caret { display: inline-block; width: 2px; height: 24px; background: var(--accent); vertical-align: -4px; margin-left: 2px; }
.cp-btn {
  display: inline-block; flex: none; font-family: var(--font-display); font-size: 12px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; border-radius: 4px; padding: 12px 26px;
  background: var(--accent); color: var(--ink-0);
}
.cp-read {
  display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--text-on-ink-faint); opacity: 0;
}
.cp-read b { font-weight: 400; color: var(--accent); }

/* the four sources the question fans out to */
.cp-src {
  position: absolute; top: 180px; width: 232px; height: 108px; padding: 16px 18px 14px;
  background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 6px; opacity: 0;
}
.cp-src__n { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-on-ink); }
.cp-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.cp-dot--wait { background: transparent; border: 1.5px solid var(--text-on-ink-faint); }
.cp-dots { position: relative; width: 7px; height: 7px; flex: none; }
.cp-dots i { position: absolute; left: 0; top: 0; }
.cp-src__st { position: relative; height: 40px; margin-top: 14px; }
.cp-src__st span { position: absolute; left: 0; bottom: 0; white-space: nowrap; }
.cp-src__st .cp-st--a { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; color: var(--text-on-ink-faint); }
.cp-src__st .cp-st--b { opacity: 0; display: flex; align-items: baseline; gap: 8px; }
.cp-src__st .cp-st--b b { font-family: var(--font-display); font-size: 30px; font-weight: 300; line-height: 1; color: var(--text-on-ink); }
.cp-src__st .cp-st--b em { font-style: normal; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--text-on-ink-muted); }

/* the lines from the question to the sources and back */
.cp-lines { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.cp-lines path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: butt; vector-effect: non-scaling-stroke; }

/* the answer */
.cp-answer {
  position: absolute; left: 116px; top: 336px; width: 1000px; padding: 26px 32px 24px;
  background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 6px; opacity: 0;
}
.cp-answer__h { display: flex; align-items: baseline; gap: 18px; }
.cp-answer__h .cp-mono { margin-left: auto; color: var(--text-on-ink-faint); }
.cp-answer__p { margin-top: 14px; font-size: 21px; line-height: 1.6; color: var(--text-on-ink); }
.cp-s { opacity: 0; }
.cp-cite {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: 2px;
  min-width: 26px; height: 22px; padding: 0 6px; margin: 0 6px 0 4px; border-radius: 3px;
  border: 1px solid var(--accent); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--accent); line-height: 1;
}
.cp-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-line); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; }
.cp-foot__r { display: flex; align-items: center; gap: 10px; height: 28px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.03em; color: var(--text-on-ink-muted); white-space: nowrap; opacity: 0; }
.cp-foot__r .cp-cite { margin: 0; }
.cp-foot__r b { font-weight: 400; color: var(--text-on-ink); }
.cp-foot__r i { font-style: normal; color: var(--text-on-ink-faint); margin-left: auto; }

/* the citation popover, rises under chip 1 */
.cp-pop {
  position: absolute; width: 440px; padding: 16px 20px 18px; z-index: 6;
  background: var(--ink-3); border: 1px solid var(--accent); border-radius: 6px; opacity: 0;
}
.cp-pop__k { display: flex; align-items: center; gap: 10px; }
.cp-pop__src { margin-top: 8px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--text-on-ink-muted); }
.cp-pop__q { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--accent); font-size: 20px; line-height: 1.45; color: var(--text-on-ink); }
.cp-pop__q b { font-weight: 500; color: var(--accent); }

/* ---------- Trace ---------- */
.cp-trace__h { position: absolute; left: 116px; top: 36px; display: flex; align-items: baseline; gap: 18px; }
.cp-pane__t { font-family: var(--font-display); font-size: 22px; font-weight: 300; letter-spacing: 0.1em; text-transform: uppercase; }
.cp-pane__s { font-size: 14px; color: var(--text-on-ink-muted); }
.cp-edge { position: absolute; left: 116px; top: 100px; width: 720px; height: 460px; overflow: visible; }
.cp-edge rect { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cp-edge .cp-edge__dash { stroke-dasharray: 6 8; opacity: 0; }
.cp-edge__k { position: absolute; left: 134px; top: 91px; padding: 0 8px; background: var(--ink-0); color: var(--accent); }
.cp-out { position: absolute; left: 900px; top: 100px; width: 216px; height: 460px; border-left: 1px dashed var(--ink-line); padding-left: 22px; }
.cp-out .cp-k { display: block; margin-top: 8px; }
.cp-out__t { margin-top: 10px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--text-on-ink-faint); line-height: 1.8; }
.cp-node {
  position: absolute; width: 200px; height: 96px; padding: 18px 20px 0;
  background: var(--ink-2); border: 1px solid var(--ink-line-strong); border-radius: 6px; opacity: 0;
}
.cp-node__n { font-family: var(--font-display); font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-on-ink); }
.cp-node__s { margin-top: 6px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--text-on-ink-muted); white-space: nowrap; }
.cp-wire { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.cp-wire path { fill: none; stroke: var(--ink-line-strong); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.cp-wire .cp-wire__probe { stroke: var(--accent); }
.cp-pkt { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); opacity: 0; }
.cp-stop { position: absolute; left: 836px; top: 440px; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 1.5px solid var(--accent); background: var(--ink-0); opacity: 0; }
.cp-stop::after { content: ""; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cp-tag {
  position: absolute; left: 862px; top: 416px; padding: 8px 12px; border-radius: 4px;
  background: var(--accent); color: var(--ink-0); font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.06em;
  white-space: nowrap; opacity: 0;
}
.cp-tag span { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; margin-top: 2px; }

/* ---------- Briefs ---------- */
.cp-memo {
  position: absolute; left: 236px; top: 40px; width: 760px; padding: 36px 44px 32px;
  background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 6px;
}
.cp-memo__k { display: flex; align-items: center; gap: 14px; }
.cp-memo__k .cp-mono { color: var(--text-on-ink-faint); }
.cp-memo__t { margin-top: 12px; font-family: var(--font-display); font-size: 32px; font-weight: 300; letter-spacing: 0.04em; line-height: 1.15; color: var(--text-on-ink); }
.cp-memo__m { margin-top: 8px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--text-on-ink-faint); }
.cp-memo__p { margin-top: 18px; font-size: 21px; line-height: 1.55; color: var(--text-on-ink-muted); }
.cp-memo__p b { font-weight: 400; color: var(--text-on-ink); }
.cp-memo__f { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--ink-line); display: flex; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: var(--text-on-ink-faint); }
.cp-memo__f i { flex: 1; height: 34px; border: 1px solid var(--ink-line); border-radius: 4px; }
.cp-memo__f em { font-style: normal; color: var(--text-on-ink-muted); }
.cp-l { opacity: 0; }

/* ---------- cursor, ring, captions ---------- */
.cp-cursor { position: absolute; left: 0; top: 0; width: 18px; height: 24px; z-index: 30; color: var(--text-on-ink); opacity: 0; }
.demo[data-demo="case-project"] .cp-ring { border-radius: 6px; box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.12); }

/* This frame is wide, so captions are set at reading size. Ink chip, brass rule. */
.demo[data-demo="case-project"] .demo__caption {
  background: rgba(7, 9, 12, 0.88);
  border-left: 2px solid var(--accent);
  padding: 9px 16px 9px 14px;
  border-radius: 2px;
  max-width: 74%;
  line-height: 1.5;
  font-size: clamp(0.9rem, 1.15cqw, 1.05rem);
}
