/* Scenes: mini product cards that step through a story. Finished state is the default. */
.scene { margin: 0 auto; max-width: 520px; width: 100%; position: relative; }
.scene-tag {
  display: inline-flex; align-items: center; min-height: 24px; margin-bottom: var(--s-8);
  padding: 0 var(--s-12); border-radius: var(--r-pill); background: var(--surface);
  color: var(--muted); font-size: var(--fs-12); font-weight: 700;
}
.scene-card {
  background: var(--surface); border-radius: var(--r-20); box-shadow: var(--shadow-1);
  padding: var(--s-16); display: flex; flex-direction: column; gap: var(--s-16);
}
@media (min-width: 480px) { .scene-card { padding: var(--s-32); } }
.scene-perch { position: absolute; top: -44px; right: var(--s-32); z-index: 1; }

.scene-row {
  display: grid; grid-template-columns: 32px 1fr auto 16px; align-items: center;
  gap: var(--s-12); font-size: var(--fs-14); line-height: 1.4;
}
.scene-row p { margin: 0; min-width: 0; }
.scene-row b { font-weight: 700; }
.scene-row time { color: var(--muted); font-size: var(--fs-12); white-space: nowrap; }
.scene-row em { display: block; font-style: normal; color: var(--muted); font-size: var(--fs-12); }
.scene-face { width: 32px; height: 32px; display: grid; place-items: center; }
.scene-face svg { display: block; width: 32px; height: 32px; }
.scene-dot {
  border-radius: 50%; background: var(--surface-2); color: var(--muted);
  font-size: var(--fs-12); font-weight: 700; display: grid; place-items: center; width: 32px; height: 32px;
}
.scene-tick { color: #1D7A4A; }
.scene-rows { list-style: none; margin: 0; padding: 0 0 0 var(--s-12); display: flex; flex-direction: column; gap: var(--s-8); }
.scene-rows .scene-row { grid-template-columns: 32px 1fr 16px; }

.scene-chips { display: grid; margin-top: var(--s-8); }
.scene-chips .chip { grid-area: 1 / 1; justify-self: start; }
.chip-peach { background: var(--peach); }
.scene:not(.is-playing) .chip-a, .chip-a:has(~ .chip-b.on) { opacity: 0; }

/* Reveal states, only while a scene is playing. */
@media (prefers-reduced-motion: no-preference) {
  .scene-row, .scene-chips .chip, .scene-tick, .how-node, .how-line {
    transition: opacity 400ms ease-out, transform 400ms ease-out;
  }
  .scene.is-playing [data-at]:not(.on), .day-feed.is-playing [data-at]:not(.on) {
    opacity: .25; transform: translateY(8px);
  }
  .scene.is-playing .scene-chips [data-at]:not(.on) { opacity: 0; }
  .scene.is-playing .scene-row:not(.on) .scene-tick { transform: scale(.6); }
  .scene.is-playing .how-line:not(.on) { transform: none; }
  .scene-how.is-playing .how-line.on .how-dot { animation: how-go 1200ms ease-out both; }
}
@keyframes how-go { from { transform: translateX(0); } to { transform: translateX(48px); } }

/* How Knoqd works */
.scene-how { max-width: none; }
.scene-how-grid { display: grid; grid-template-columns: 1fr 48px 1fr 48px 1fr; align-items: stretch; gap: var(--s-8); }
.how-node {
  background: var(--surface); border-radius: var(--r-20); box-shadow: var(--shadow-1);
  padding: var(--s-24); min-height: 168px;
}
.how-node h3 { margin: 0 0 var(--s-12); font-size: var(--fs-20); }
.how-chip { margin-top: var(--s-12) !important; }
.how-node p { margin: 0; color: var(--muted); font-size: var(--fs-14); }
.how-faces { display: flex; flex-wrap: wrap; gap: var(--s-4); }

.how-line { width: 48px; height: 40px; align-self: center; color: var(--muted); overflow: visible; }
.how-dot { transform: translateX(48px); }
@media (max-width: 640px) {
  .scene-how-grid { grid-template-columns: 1fr; justify-items: stretch; }
  .how-node { min-height: 0; }
  .how-line { justify-self: center; rotate: 90deg; height: 40px; }
}

[data-count] { font-variant-numeric: tabular-nums; }

/* Status chips: shared by every page that has a scene. */
.chip {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  border-radius: var(--r-12);
  color: var(--ink);
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1;
  padding: var(--s-8) var(--s-12);
}

.chip-pink {
  background: var(--pink);
}

.chip-mint {
  background: var(--mint);
}

.chip-lavender {
  background: var(--lavender);
}

/* Stacked scenes leave room for the helper perched on the next card. */
.scene:not(.scene-how) + .scene { margin-top: 88px; }

/* Wide stage behind a scene, or a pair of scenes. */
.stage {
  display: grid;
  justify-items: center;
  border-radius: var(--r-28);
  background: var(--surface-2);
  padding: 88px var(--s-48) var(--s-48);
}
@media (min-width: 900px) {
  .stage:has(.scene + .scene) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-32); }
  .stage .scene + .scene { margin-top: 0; }
}
@media (max-width: 640px) { .stage { padding: 72px var(--s-12) var(--s-12); border-radius: var(--r-20); } }

/* Small picture at the top of a step: a helper or an icon on a tinted tile. */
.how-art { display: flex; align-items: center; gap: var(--s-4); min-height: 56px; margin-bottom: var(--s-12); }
.how-art .av-svg { width: 56px; height: 56px; }
.how-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-12); background: var(--surface-2); }
.how-icon.tint-mint { background: var(--mint); }
.how-icon.tint-peach { background: var(--peach); }
.how-icon.tint-pink { background: var(--pink); }
.how-icon.tint-lavender { background: var(--lavender); }
.how-icon svg { width: 28px; height: 28px; }

/* Four steps in a row. */
.scene-how-grid.is-four { grid-template-columns: 1fr 48px 1fr 48px 1fr 48px 1fr; }
.scene-how-grid.is-four .how-node { padding: var(--s-16); }
@media (max-width: 900px) {
  .scene-how-grid.is-four { grid-template-columns: 1fr; justify-items: stretch; }
  .scene-how-grid.is-four .how-node { min-height: 0; padding: var(--s-24); }
  .scene-how-grid.is-four .how-line { justify-self: center; rotate: 90deg; }
}

/* Fork: one starting point splits into outcomes. */
.fork-root { width: 100%; max-width: 420px; min-height: 0; margin-inline: auto; text-align: center; }
.fork-root .how-art { justify-content: center; }
.fork-arms { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-24); padding-top: var(--s-48); }
.fork-arms::before { content: ""; position: absolute; top: 0; left: calc(50% - 1px); width: 2px; height: var(--s-24); background: var(--muted); }
.fork-arms::after {
  content: ""; position: absolute; top: var(--s-24); left: 25%; right: 25%; height: var(--s-24);
  border: 2px solid var(--muted); border-bottom: 0; border-radius: var(--r-12) var(--r-12) 0 0;
}
.fork-arms.is-three::after { left: calc(100% / 6); right: calc(100% / 6); }
.fork-arms .how-node { min-height: 0; }
@media (max-width: 640px) {
  .fork-arms { grid-auto-flow: row; gap: var(--s-12); }
  .fork-arms::after { display: none; }
  .fork-arms::before { height: var(--s-48); }
}

/* Track: steps along a line, ending with a person. */
.track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.track-step { position: relative; padding: var(--s-32) var(--s-16) 0 0; }
.track-step::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--muted); }
.track-step:last-child::before { display: none; }
.track-step::after { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); }
.track-step.is-end::after { background: var(--lime); box-shadow: 0 0 0 2px var(--ink); }
.track-step h3 { margin: 0 0 var(--s-4); font-size: var(--fs-20); }
.track-step p { margin: 0; color: var(--muted); font-size: var(--fs-14); }
.track-note {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-12);
  margin: var(--s-32) 0 0; font-size: var(--fs-14);
}
@media (max-width: 640px) {
  .track { grid-auto-flow: row; }
  .track-step { padding: 0 0 var(--s-24) var(--s-32); }
  .track-step::before { top: 0; bottom: 0; left: 7px; right: auto; width: 2px; height: auto; }
}

/* Before and after: two cards side by side, the second in ink. */
.scene-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-24); }
.scene-compare .how-node { min-height: 0; }
.scene-compare .how-node.is-after { background: var(--ink); color: var(--surface); }
.scene-compare .how-node.is-after p { color: var(--side-muted); }
.scene-compare ul { display: grid; gap: var(--s-8); margin: 0; padding: 0; list-style: none; font-size: var(--fs-14); }
@media (max-width: 640px) { .scene-compare { grid-template-columns: minmax(0, 1fr); } }

/* Two steps fill the width. */
@media (min-width: 641px) { .scene-how-grid:has(> :nth-child(3):last-child) { grid-template-columns: 1fr 48px 1fr; } }
