/* Design C1 "נקודות חיות": the module dots on design C's ring wait as small calm points until the story lights them;
 * a dot under the pointer or the keyboard grows, and its card opens beside the clock (a sheet under it on phones)
 * with the module's real scene in a small phone. Loaded after css/test-home-motion-c.css.
 */

/* ---------- the dots ---------- */

html.c-live-on .c-chip:not(.on) .c-chip-dot { transform: scale(0.36); }
html.c-live-on .c-chip:not(.on) .c-chip-dot circle { opacity: 0.42; }
html.c-live-on .c-chip:not(.on) .c-chip-dot path { opacity: 0; }
html.c-live-on .c-chip-dot circle, html.c-live-on .c-chip-dot path { transition: opacity 0.3s ease, stroke-width 0.2s ease; }
html.c-live-on .c-chip-dot circle { stroke: var(--surface); stroke-width: 0; paint-order: stroke; }

html.c-live-on .c-chip.is-hot .c-chip-dot,
html.c-live-on .c-chip.is-open .c-chip-dot,
html.c-live-on .c-chip.is-focus .c-chip-dot { transform: scale(1.5); }

html.c-live-on .c-chip.is-hot .c-chip-dot circle,
html.c-live-on .c-chip.is-open .c-chip-dot circle,
html.c-live-on .c-chip.is-focus .c-chip-dot circle { opacity: 1; stroke-width: 3; }

html.c-live-on .c-chip.is-hot .c-chip-dot path,
html.c-live-on .c-chip.is-open .c-chip-dot path,
html.c-live-on .c-chip.is-focus .c-chip-dot path { opacity: 1; }

html.c-live-on .c-chip.is-open .c-chip-dot circle { stroke: var(--ink); }
html.c-live-on .c-chip.is-focus .c-chip-dot circle { stroke: var(--indigo); stroke-width: 4; }
html.c-live-open .c-done .c-orbit { animation-play-state: paused; }
html.c-live-hot, html.c-live-hot * { cursor: pointer; }

.c-live-hint { display: flex; align-items: center; gap: 10px; margin: -12px 0 24px; color: var(--ink-2); font-size: 15px; }
.c-live-hint::before { content: ''; width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px #ffe1d8; }

/* the keyboard's way to the dots: one tab stop, the focus shows on the dot itself */
.c-live-dot { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- the card ---------- */

.c-live {
  --ps: 0.5; /* the phone's scale: the scenes are drawn at 300 x 620 */
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  width: 440px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'body phone';
  gap: 18px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 2px 4px rgba(30, 27, 58, 0.06), 0 30px 60px -24px rgba(30, 27, 58, 0.45);
  color: var(--ink);
  text-align: start;
  animation: c-live-in 0.32s var(--ease-out);
}

.c-live[hidden] { display: none; }

@keyframes c-live-in {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.c-live p { margin: 0; }
.c-live-body { grid-area: body; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.c-live-head { display: flex; align-items: flex-start; gap: 11px; }
.c-live-head .c-ico { width: 34px; height: 34px; border-radius: 11px; }
.c-live-head .c-ico svg { width: 19px; height: 19px; }
.c-live-title { flex: 1; min-width: 0; }
.c-live-cat { color: var(--cat-ink); font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.c-live h3 { margin: 1px 0 0; font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }

.c-live button { font: inherit; color: inherit; cursor: pointer; }
.c-live button:focus-visible, .c-live a:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.c-live svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.c-live-close {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  margin: -6px -6px 0 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2) !important;
}

.c-live-close:hover { background: var(--bg-2); color: var(--ink) !important; }
.c-live-close svg { width: 18px; height: 18px; }

.c-live-desc { color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }

.c-live-beat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--cat-soft); }
.c-live-step { color: var(--cat-ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c-live-beat-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.c-live-beat-text { color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.c-live-beat:has(.c-live-step:empty) { visibility: hidden; }

.c-live-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.c-live-nav { display: flex; align-items: center; gap: 6px; }

.c-live-nav button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.c-live-nav button:hover:not(:disabled) { background: var(--bg-2); }
.c-live-nav button:disabled { opacity: 0.35; cursor: default; }
.c-live-nav svg { width: 17px; height: 17px; }
.c-live-pips { display: flex; gap: 4px; }
.c-live-pips i { width: 6px; height: 6px; border-radius: 99px; background: var(--line); transition: width 0.3s var(--ease-out), background 0.3s ease; }
.c-live-pips i.on { width: 16px; background: var(--cat); }

.c-live-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.c-live-link:hover { background: #2b2754; }

/* the phone */
.c-live-phone { grid-area: phone; align-self: start; padding: 6px; border-radius: 30px; background: var(--ink); box-shadow: 0 14px 28px -16px rgba(30, 27, 58, 0.55); }

.c-live-glass {
  position: relative;
  width: calc(300px * var(--ps));
  height: calc(620px * var(--ps));
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
}

.c-live-screen { position: absolute; top: 0; left: 0; width: 300px; height: 620px; transform: scale(var(--ps)); transform-origin: 0 0; }
.c-live-wait { position: absolute; inset: 0; display: none; place-items: center; padding: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.45; text-align: center; }
.c-live.is-loading .c-live-glass, .c-live.is-failed .c-live-glass { background: var(--bg); }
.c-live.is-loading .c-live-wait, .c-live.is-failed .c-live-wait { display: grid; }

@media (min-width: 901px) and (max-height: 780px) {
  .c-live { --ps: 0.44; }
  .c-live-beat-text { display: none; }
}

/* a plain card (a page without the scenes): the module's name, its sentence and its link */
.c-live.is-plain { width: 340px; grid-template-columns: minmax(0, 1fr); grid-template-areas: 'body'; }
.c-live.is-plain .c-live-phone, .c-live.is-plain .c-live-beat, .c-live.is-plain .c-live-nav { display: none; }
.c-live.is-plain .c-live-foot { justify-content: flex-start; }

/* ---------- phones: a sheet under the clock ---------- */

.c-live.is-sheet {
  --ps: 0.42;
  top: auto !important;
  left: 10px !important;
  right: 10px;
  bottom: 10px;
  width: auto;
  max-width: 560px;
  margin-inline: auto;
  gap: 12px;
  padding: 14px;
  animation-name: c-live-up;
}

@keyframes c-live-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.c-live.is-sheet .c-live-body { gap: 9px; }
.c-live.is-sheet h3 { font-size: 17px; }
.c-live.is-sheet .c-live-head .c-ico { width: 30px; height: 30px; }
.c-live.is-sheet .c-live-desc { font-size: 13.5px; line-height: 1.45; }
.c-live.is-sheet .c-live-beat { padding: 8px 10px; }
.c-live.is-sheet .c-live-beat-title { font-size: 14px; }
.c-live.is-sheet .c-live-beat-text { display: none; }
.c-live.is-sheet .c-live-phone { padding: 5px; border-radius: 24px; }
.c-live.is-sheet .c-live-glass { border-radius: 19px; }
.c-live.is-sheet .c-live-link { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.c-live.is-plain.is-sheet { bottom: 84px; } /* above the page's floating chat and accessibility buttons */

@media (max-width: 900px) {
  .c-live-hint { margin: -8px 0 18px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .c-live, .c-live.is-sheet { animation: none; }
  html.c-live-on .c-chip-dot circle, html.c-live-on .c-chip-dot path, .c-live-pips i, .c-live-nav button { transition: none; }
}
