/* Capital CRM · Opportunities: case-scoped figure styles.
   Grounds use Capital CRM primitives: khaki 400 → 300 → 100 for record and form
   plates; blue 700 → 500 for the queue hero (baked into queue-plate.webp).
   Product captures keep their own color and type; grain sits on the ground only.
   Everything is scoped under .co[data-case="capital-crm-opportunities"]. */

.co[data-case="capital-crm-opportunities"] {
  --crm-k100: #f2f0eb; --crm-k300: #d9d3c7; --crm-k400: #c5bdb0; --crm-k900: #2d2a27;
  --crm-ring: rgb(232, 163, 61);
  --crm-shadow: 0 1px 2px rgba(45, 42, 39, .10), 0 18px 40px -18px rgba(45, 42, 39, .45);
}
.co[data-case="capital-crm-opportunities"] .crm-reflect { color: var(--co-muted); }

/* ---- Figure shell: stage, then a persistent bar (tabs + caption). Dense
   product UI needs its caption in view, so these don't use the hover chip. ---- */
.crm-fig { display: flex; flex-direction: column; gap: 10px; }
.co .crm-fig figcaption, .co .crm-fig .crm-bar--solo {
  position: static; max-width: none; opacity: 1; transform: none; pointer-events: auto;
  padding: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  font: 400 14px/1.5 "Season Sans Regular", sans-serif; color: var(--co-muted); text-wrap: pretty;
}
.crm-bar { display: flex; align-items: center; gap: 16px; min-height: 32px; }
.crm-bar figcaption { flex: 1 1 auto; min-width: 0; }
.crm-bar--solo { display: block; }

.crm-tabs { flex: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgb(28, 28, 28); box-shadow: inset 0 0 0 1px var(--co-line); }
.crm-tabs [role="tab"] {
  appearance: none; border: 0; margin: 0; cursor: pointer; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px; background: transparent;
  font: 550 13px/1.3 "Season Sans Medium", sans-serif; color: var(--co-muted);
  transition: background-color .2s, color .2s;
}
.crm-tabs [role="tab"]:hover { color: var(--co-ink); }
.crm-tabs [role="tab"][aria-selected="true"] { background: rgb(58, 58, 58); color: var(--co-ink); }
.crm-tabs [role="tab"]:focus-visible, .crm-play:focus-visible { outline: 2px solid var(--site-accent, rgb(232, 163, 61)); outline-offset: 2px; }

.crm-play {
  flex: none; appearance: none; border: 0; margin: 0; cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: rgb(44, 44, 44); color: var(--co-ink);
}
.crm-play:hover { background: rgb(58, 58, 58); }
.crm-play span { width: 10px; height: 12px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; box-sizing: border-box; }
.crm-play[aria-pressed="true"] span { width: 0; height: 0; border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }

/* ---- Stage and states. All states share one grid cell, so switching never
   changes the figure's height. ---- */
.crm-stage { position: relative; display: grid; border-radius: var(--co-r); overflow: hidden; }
.crm-stage > .crm-state { grid-area: 1 / 1; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.crm-stage > .crm-state[hidden] { display: flex; visibility: hidden; }
.crm-stage[style*="--crm-ar"] { aspect-ratio: var(--crm-ar); }

.crm-ground { padding: clamp(16px, 3.4%, 40px); background: linear-gradient(158deg, var(--crm-k400) 0%, var(--crm-k300) 46%, var(--crm-k100) 100%); }
.crm-ground::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .18  0 0 0 0 .16  0 0 0 0 .15  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.crm-ground > * { position: relative; }

/* A capture sits flat on the ground; rings and loupes position against it. */
.crm-shot { position: relative; display: block; }
.crm-shot > img, .crm-shot > video { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: var(--crm-shadow); background: #fff; }
.crm-fit-w { width: 100%; }
.crm-fit-h { height: 100%; }
.crm-fit-h > img, .crm-fit-h > video { width: auto; height: 100%; max-width: 100%; object-fit: contain; }

/* Ring: marks the source of an enlargement, or the thing the caption names. */
.crm-ring { position: absolute; border-radius: 8px; box-shadow: 0 0 0 2px var(--crm-ring), 0 0 0 6px rgba(232, 163, 61, .22); pointer-events: none; }

/* Loupe: an enlarged excerpt of the same capture, at or near native size. */
.crm-loupe { display: block; border-radius: 10px; box-shadow: 0 0 0 1px rgba(45, 42, 39, .12), 0 22px 48px -14px rgba(10, 18, 34, .55); background: #fff; }

/* ---- 01 hero ---- */
.crm-hero-plate { position: relative; width: 100%; }
.crm-hero-plate picture, .crm-hero-plate picture img { display: block; width: 100%; height: auto; border-radius: var(--co-r); }
.crm-loupe--hero { position: absolute; left: 4%; bottom: 5%; width: 40%; height: auto; }
.crm-loupe--hero::after { content: none; }

/* Stage board state: the same blue ground as the Needs you plate. */
.crm-board-plate { width: 100%; aspect-ratio: 2880 / 1520; box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: 4.5% 5.2%; border-radius: var(--co-r); background: linear-gradient(120deg, #0a1c3a 0%, #163060 55%, #90acdf 100%); }
.crm-board-plate img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 24px 60px -20px rgba(4, 7, 11, .6); }

/* ---- 02 full profile chip loupe ---- */
.crm-loupe--chip { position: absolute; left: 7%; top: 6%; width: 48%; height: auto; }

/* ---- 03 note sequence ---- */
.crm-note { display: flex; flex-direction: column; gap: 20px; }
.crm-note-row > img { border-radius: 6px; }
.crm-note-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; margin: 0; padding: 0; list-style: none; }
.crm-note-steps li { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.crm-note-steps .crm-shot { max-width: 420px; }
.crm-step { font: 550 13px/1.3 "Season Sans Medium", sans-serif; color: var(--crm-k900); }

/* ---- 04 board: film beside the message at native size ---- */
.crm-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(16px, 3%, 32px); align-items: center; }
.crm-side { display: flex; flex-direction: column; gap: 12px; }
.crm-side .crm-loupe { width: 100%; max-width: 440px; height: auto; }
.crm-vidwrap { max-width: 560px; justify-self: end; width: 100%; }
.crm-side-note { font: 400 14px/1.5 "Season Sans Regular", sans-serif; color: var(--crm-k900); max-width: 34ch; }

/* Chapter rule in the media column: gives exhibits 04–08 a heading of their own. */
.crm-chapter {
  margin: 28px 0 4px; padding-top: 14px; border-top: 1px solid var(--co-line);
  font: 420 20px/1.3 "Season Mix Regular", serif; color: var(--co-ink); letter-spacing: -0.005em;
}

/* ---- Phone and narrow tablet ---- */
@media (max-width: 899px) {
  .crm-bar { flex-wrap: wrap; gap: 10px; }
  .crm-tabs { max-width: 100%; overflow-x: auto; }
  /* The phone hero (queue-mobile.webp) already leads with the reason card. */
  .crm-loupe--hero { display: none; }
  .crm-note-row { display: none; }
  .crm-hero-plate .crm-ring { display: none; }
  .crm-loupe--chip { position: static; width: 100%; margin-top: 10px; }
  .crm-stage[style*="--crm-ar"] { aspect-ratio: auto; }
  .crm-fit-h { height: auto; }
  .crm-fit-h > img, .crm-fit-h > video { width: 100%; height: auto; }
  .crm-note-steps, .crm-split { grid-template-columns: minmax(0, 1fr); }
  .crm-note-steps .crm-shot { max-width: none; }
  .crm-chapter { margin: 20px 12px 8px !important; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .crm-tabs [role="tab"] { transition: none; }
}
