/* The staged KhuHu Compass card (partials/compass-demo.html), on Features and
   the free note taker page. Every class starts cx- so none can clash with
   site.css. No script.

   The card keeps the colours it has in the extension's panel (violet for
   Cloud, green for Covered, blue for Discussing), light and dark, so the
   website shows the real thing.

   Three states take turns in one loop (--cx-loop): the agenda at the start,
   the question to ask, the first item covered. They sit on top of each other
   and only opacity and transform change, so the page is never laid out again
   while it plays. Without motion (the visitor asked for less, or an old
   browser) the question state shows and nothing moves. A looping example
   needs a way to stop it: the "Pause the example" box under the card. */
/* The card and its three points sit side by side where there is room for
   both, and stack where there is not (a phone, or the narrow column of the
   Features page on a tablet). */
.cx-demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 28px 48px; align-items: start; max-width: 880px; }
.cx-wrap { margin: 0; min-width: 0; max-width: 420px; }
.cx-wrap figcaption { margin-top: 10px; font-size: .85rem; color: var(--muted); }
.cx-points { margin-top: 6px; }

.cx {
  --cx-accent: #6941c6; --cx-accent-soft: #eee8fb;
  --cx-surface: #ffffff; --cx-surface-2: #eee9f9; --cx-line: #e0d9f0;
  --cx-fg: #17202e; --cx-muted: #5b6676;
  --cx-live: #1a8f5a; --cx-live-soft: #def3e7;
  --cx-blue: #3a4fb8; --cx-blue-soft: #e6e9fb;
  --cx-loop: 18s;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px 18px; border: 1px solid var(--cx-line); border-radius: 14px;
  background: var(--cx-surface); color: var(--cx-fg);
  box-shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 10px 28px rgba(27, 36, 64, .10);
  font: 14px/1.45 var(--sans);
}
@media (prefers-color-scheme: dark) {
  .cx {
    --cx-accent: #bfa9f4; --cx-accent-soft: #35295a;
    --cx-surface: #24272d; --cx-surface-2: #2c2f36; --cx-line: #363a42;
    --cx-fg: #e9eaee; --cx-muted: #a0a5ad;
    --cx-live: #4cc38a; --cx-live-soft: #1f3a2d;
    --cx-blue: #a5b1f5; --cx-blue-soft: #2a2f4a;
    box-shadow: none;
  }
}
.cx p, .cx ul { margin: 0; padding: 0; list-style: none; }
.cx li { margin: 0; }
.cx b { font-weight: 650; }
.cx svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.cx-head { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; column-gap: 10px; }
.cx .cx-spark { width: 26px; height: 26px; fill: var(--cx-accent); stroke: none; }
.cx-titles b { display: block; font-size: 1.12rem; line-height: 1.25; }
.cx-titles span { display: block; font-size: .86rem; color: var(--cx-muted); }
.cx-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--cx-line); border-radius: 8px; background: var(--cx-surface); font-size: .86rem; font-weight: 600; }
.cx-btn svg { width: 14px; height: 14px; }
.cx-switch { display: block; width: 36px; height: 21px; padding: 2px; border-radius: 999px; background: var(--cx-accent); }
.cx-switch i { display: block; width: 17px; height: 17px; margin-left: auto; border-radius: 50%; background: var(--cx-surface); }

.cx-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--cx-live-soft); color: var(--cx-live); font-size: .86rem; font-weight: 600; }
.cx-chip svg { width: 15px; height: 15px; stroke-width: 2; }
.cx-goal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cx-pill { flex: none; padding: 1px 9px; border-radius: 999px; background: var(--cx-surface-2); color: var(--cx-muted); font-size: .8rem; font-weight: 650; }
.cx-pill.discussing { background: var(--cx-blue-soft); color: var(--cx-blue); }
.cx-pill.covered { background: var(--cx-live-soft); color: var(--cx-live); }

/* The three states share one cell; the tallest sets the height. */
.cx-stage { display: grid; }
.cx-frame { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 8px; opacity: 0; }
.cx-frame.f2 { opacity: 1; }

.cx-progress { display: flex; align-items: center; gap: 12px; }
.cx-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--cx-surface-2); overflow: hidden; }
.cx-bar i { display: block; width: 33.4%; height: 100%; border-radius: 999px; background: var(--cx-live); transform-origin: left center; }
.cx-items li { display: flex; align-items: flex-start; gap: 9px; padding: 11px 0; border-top: 1px solid var(--cx-line); }
.cx-items li > span:first-of-type { flex: 1; }
.cx-ico { width: 19px; height: 19px; margin-top: 1px; color: var(--cx-muted); }
.cx-ico.discussing { color: var(--cx-blue); stroke-dasharray: 3.4 3.4; }
.cx-ico.covered { color: var(--cx-live); }

.cx-ask { display: flex; flex-direction: column; gap: 5px; padding: 11px 12px 12px; border: 1px solid var(--cx-accent); border-radius: 9px; background: var(--cx-accent-soft); }
.cx-ask-h { color: var(--cx-accent); }
.cx-q { font-weight: 650; }
.cx-why { font-size: .88rem; color: var(--cx-muted); }
.cx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.cx-actions .cx-btn { padding: 4px 10px; }
/* Three buttons on one row on a phone too (the third is "Another question"); below about 350px wide they wrap. */
@media (max-width: 480px) { .cx-actions { gap: 4px; } .cx-actions .cx-btn { padding: 4px 8px; font-size: .8rem; white-space: nowrap; } }

/* Shown only where the loop runs. */
.cx-pause { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .cx.playing .cx-frame.f1 { animation: cx-f1 var(--cx-loop) ease-in-out infinite; }
  .cx.playing .cx-frame.f2 { animation: cx-f2 var(--cx-loop) ease-in-out infinite; }
  .cx.playing .cx-frame.f3 { animation: cx-f3 var(--cx-loop) ease-in-out infinite; }
  .cx.playing .f3 .cx-bar i { animation: cx-bar var(--cx-loop) ease-out infinite; }
  .cx-pause { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; font-size: .9rem; color: var(--muted); cursor: pointer; }
  .cx-pause input { width: 18px; height: 18px; margin: 0; accent-color: var(--fg); }
  .cx-wrap:has(.cx-pause input:checked) .cx.playing * { animation-play-state: paused; }
}
@keyframes cx-f1 { 0%, 26% { opacity: 1; } 30%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes cx-f2 { 0%, 26% { opacity: 0; transform: translateY(8px); } 30%, 62% { opacity: 1; transform: none; } 66%, 100% { opacity: 0; transform: none; } }
@keyframes cx-f3 { 0%, 62% { opacity: 0; } 66%, 96% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cx-bar { 0%, 68% { transform: scaleX(0); } 75%, 100% { transform: scaleX(1); } }

