/* Illustrations in the demo guide (demo-scenes.js). What sits on the counter is drawn on zinc, seen from above;
   sums and lists stay flat on the page. Scenes rest on their last frame, so nothing is lost without motion. */
.scene { margin: 20px 0 0; }
.scene figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 18px; }
.guide-hero .scene { margin-top: 18px; }
.guide .scene + ul.plain { margin-top: 16px; }
.stage {
  position: relative; overflow: hidden; border-radius: 14px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, rgba(26, 31, 54, 0.014) 1px 3px),
    linear-gradient(112deg, #e9edf2, #d6dce4 46%, #e6eaef 68%, #d3d9e1);
  box-shadow: inset 0 0 0 1px rgba(26, 31, 54, 0.07);
}
.stage svg { display: block; width: 100%; height: auto; font-family: var(--font); -webkit-user-select: none; user-select: none; }
.stage text { fill: var(--ink); }
.stage text.mute { fill: var(--muted); }
.stage text.white { fill: #fff; }
.stage text.good { fill: var(--success-ink); }
.stage text.bad { fill: var(--danger); }
.stage text.strike { text-decoration: line-through; }
.stage .sh { fill: rgba(26, 31, 54, 0.18); }

/* A frame shows the groups that list its number */
.stage [data-s] { opacity: 0; transition: opacity 0.22s; }
.stage [data-s].on { opacity: 1; }
.stage .stamp-in { transform: scale(1.7); transform-box: fill-box; transform-origin: center; }
.stage .on > .stamp-in { transform: none; transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2); }

/* Controls */
.scene-replay { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 0 0 1px rgba(26, 31, 54, 0.1); color: var(--ink); font-size: 12px; font-weight: 500; }
.scene-replay:hover { background: #fff; }
.scene-replay svg { width: 12px; height: 12px; }
.scene-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.scene-controls .scene-label { color: var(--muted); font-size: 13px; }
.chip[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--brand); color: var(--brand); }
.chip em { margin-left: 5px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.scene button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.scene-note { margin: 10px 0 0 !important; min-height: 42px; color: var(--ink); font-size: 14px; line-height: 21px; }

/* The steps under a scene: a real sequence, and each one can be opened */
.scene-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; counter-reset: sc; }
.scene-steps button { display: block; width: 100%; height: 100%; padding: 7px 8px 8px; border-radius: 8px; color: var(--muted); font-size: 13px; line-height: 17px; text-align: left; box-shadow: inset 0 0 0 1px var(--line-soft); transition: color 0.2s, box-shadow 0.2s, background 0.2s; }
.scene-steps li { counter-increment: sc; }
.scene-steps button::before { content: counter(sc); display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.scene-steps button:hover { color: var(--ink); }
.scene-steps button.on { background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.35); color: var(--ink); }

/* Phone to phone */
.tap-mover { transform: translateY(-124px); transition: transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1); }
.stage[data-near="1"] .tap-mover { transform: none; }
.stage .dev { opacity: 0; }
.stage[data-dev="phone"] .dev-phone, .stage[data-dev="watch"] .dev-watch, .stage[data-dev="card"] .dev-card { opacity: 1; }
.rings circle { fill: none; stroke: var(--brand); stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.stage.pulsing .rings circle { animation: scene-ring 0.9s ease-out infinite; }
.stage.pulsing .rings circle:nth-child(2) { animation-delay: 0.22s; }
.stage.pulsing .rings circle:nth-child(3) { animation-delay: 0.44s; }
@keyframes scene-ring { from { transform: scale(0.28); opacity: 0.95; } to { transform: scale(1.25); opacity: 0; } }
.tap-row-on { fill: var(--brand-soft); }

/* QR code: the customer's phone comes over to scan, then steps back to pay */
.qr-cust { transform-box: fill-box; transform-origin: center; transition: transform 0.7s cubic-bezier(0.3, 0.7, 0.2, 1); transform: rotate(2deg); }
.stage[data-step="0"] .qr-cust { transform: translate(72px, 26px) rotate(9deg); }
.stage[data-step="1"] .qr-cust { transform: translate(-34px, -6px) rotate(-3deg); }
.qr-scan { transition: transform 1.3s ease-in-out; transform: translateY(0); }
.stage[data-step="1"] .qr-scan { transform: translateY(96px); }
.qr-press circle { fill: var(--brand); opacity: 0; transform-box: fill-box; transform-origin: center; }
.stage[data-step="2"] .qr-press circle { animation: scene-press 0.8s 0.9s ease-out; }
@keyframes scene-press { from { transform: scale(0.3); opacity: 0.55; } to { transform: scale(1.5); opacity: 0; } }

/* Terminal: the card comes in, the terminal answers, the card leaves */
.term-card { transform-box: fill-box; transform-origin: center; transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1); }
.stage[data-step="1"] .term-card { transform: translate(-140px, -84px) rotate(-10deg); }
.stage[data-step="2"][data-v="declined"] .term-card { animation: scene-shake 0.42s 0.05s; }
@keyframes scene-shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-4px); } 90% { transform: translateX(2px); } }
.term-slip { transition: transform 0.7s 0.1s ease-out; transform: translateY(0); }
.stage:not([data-v="bank"]) .term-slip, .stage[data-v="bank"]:not([data-step="2"]) .term-slip { transform: translateY(72px); transition: none; }
.term-outcomes { margin: 12px 0 0; padding: 0; list-style: none; font-size: 14px; }
.term-outcomes li { display: flex; gap: 9px; align-items: flex-start; }
.term-outcomes li + li { margin-top: 7px; }
.term-outcomes svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }

/* Fingerprint: the ridges draw themselves once */
.fp path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.fp-mini path { stroke-width: 1.2; }
.stage.drawing .fp path { animation: scene-draw 1.3s ease-out both; }
@keyframes scene-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.fp-lists { display: grid; gap: 14px; margin-top: 12px; font-size: 14px; }
.fp-lists h4 { margin: 0 0 4px; color: var(--ink); font-size: 14px; font-weight: 600; }
.fp-lists ul { margin: 0; padding-left: 18px; }
.fp-lists ul li + li { margin-top: 3px; }
@media (min-width: 520px) { .fp-lists { grid-template-columns: 1fr 1fr; } }

/* The receipt, on the counter */
.scene-receipt { display: flex; justify-content: center; padding: 22px 16px 30px; }
.scene-receipt .bill { --bg: #fffefb; width: 100%; max-width: 310px; filter: drop-shadow(5px 7px 0 rgba(26, 31, 54, 0.14)); }
.scene-receipt h4 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; text-align: center; }
.scene-receipt .lines { margin-top: 10px; }
.scene-receipt p { margin: 8px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

/* What the customer's bank shows */
.stmt-title { margin: 0 0 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.stmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stmt { padding: 12px 12px 10px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stmt h5 { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 16px; }
.stmt-line { display: flex; justify-content: space-between; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; }
.stmt-line span:first-child { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.stmt-line b { flex: none; font-weight: 600; }
.stmt-line.back b { color: var(--success-ink); }
.stmt-sum { display: flex; justify-content: space-between; gap: 6px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Rewards: discount by visit. One series, so one colour; the visit in focus is the strongest. */
.rw-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.rw-chart { display: grid; grid-template-columns: repeat(10, 1fr); align-items: end; height: 176px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.rw-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.rw-col:hover .rw-bar { background: var(--brand); }
.rw-bar { display: block; width: min(24px, 62%); min-height: 2px; border-radius: 4px 4px 0 0; background: #aaa6ff; transition: height 0.32s cubic-bezier(0.3, 0.7, 0.2, 1), background 0.15s; }
.rw-col.none .rw-bar { background: var(--line); border-radius: 0; }
.rw-col.on .rw-bar { background: var(--brand); }
.rw-val { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rw-axis { display: grid; grid-template-columns: repeat(10, 1fr); margin-top: 5px; color: var(--muted); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.rw-axis .on { color: var(--ink); font-weight: 600; }
.rw-read { margin: 10px 0 0 !important; min-height: 42px; color: var(--ink); font-size: 14px; line-height: 21px; }
.rw-title { margin: 14px 0 0 !important; color: var(--muted); font-size: 13px; }

/* Where a bill goes: one whole, in parts. The amounts are in the lines below it. */
.route { padding: 16px 16px 14px; border-radius: 10px; background: var(--bg); }
.route h4 { margin: 0 0 12px; color: var(--ink); font-size: 14px; font-weight: 600; }
.route-bar { display: flex; gap: 2px; height: 28px; }
.route-bar i { display: flex; align-items: center; min-width: 3px; padding-left: 8px; border-radius: 4px; color: #fff; font-size: 12px; font-style: normal; font-weight: 600; white-space: nowrap; overflow: visible; font-variant-numeric: tabular-nums; }
.route-bar i.tiny { padding-left: 0; }
.route .lines { margin-top: 12px; font-size: 13px; }
.route .lines td { padding: 5px 0; }
.route .lines td:first-child { color: var(--text); }
.route .lines td:last-child { color: var(--ink); }
.route .lines .total td { color: var(--ink); font-weight: 600; font-size: 14px; }
.route .sw { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; vertical-align: -1px; }
.route p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 17px; }

/* The level card at the end of the receipt. The paper runs off the top of the stage: this is only the receipt's last part. */
.scene-level { display: flex; justify-content: center; padding: 0 16px 24px; }
.lv-col { width: 100%; max-width: 330px; min-width: 0; }
.lv-bill { --bg: #fffefb; padding-top: 12px; border-radius: 0; filter: drop-shadow(5px 7px 0 rgba(26, 31, 54, 0.14)); }
.lv-bill .lines .credit td { color: var(--success-ink); }
.lv-saved { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums; }
.lv-card { position: relative; overflow: hidden; margin-top: 24px; padding: 15px 18px 15px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #1a1f36 0%, #2b2a6b 62%, #635bff 135%); box-shadow: 5px 7px 0 rgba(26, 31, 54, 0.18); }
.lv-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, 0.24) 50%, transparent 66%); transform: translateX(-101%); }
.lv-card.won::after { animation: lv-sheen 0.95s ease-out; }
.lv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.lv-where { min-width: 0; overflow: hidden; color: rgba(255, 255, 255, 0.72); font-size: 12px; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; }
.lv-badge { flex: none; padding: 2px 9px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 600; line-height: 18px; font-variant-numeric: tabular-nums; }
.lv-head { margin-top: 12px; font-size: clamp(22px, 7.4vw, 32px); font-weight: 600; line-height: 38px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lv-sub { color: rgba(255, 255, 255, 0.78); font-size: 15px; line-height: 21px; }
.lv-marks, .lv-segs { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.lv-marks { height: 16px; margin-top: 16px; color: rgba(255, 255, 255, 0.55); font-size: 11px; font-weight: 600; line-height: 16px; font-variant-numeric: tabular-nums; }
.lv-marks span { grid-row: 1; justify-self: center; white-space: nowrap; }
.lv-marks span.end { justify-self: end; }
.lv-marks span.on { color: #fff; }
.lv-segs { margin-top: 5px; }
.lv-seg { height: 10px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); transition: background 0.14s; }
.lv-seg.on { background: #fff; }
.lv-seg.goal:not(.on) { background: transparent; box-shadow: inset 0 0 0 1.5px #fff; }
.lv-seg.goal.pulse:not(.on) { animation: lv-pulse 1s ease-out 2; }
.lv-foot { min-height: 51px; margin: 13px 0 0; color: rgba(255, 255, 255, 0.66); font-size: 12px; line-height: 17px; }
@media (max-width: 420px) { .scene-level { padding: 0 10px 20px; } .lv-card { padding-left: 16px; padding-right: 16px; } }
@keyframes lv-pulse { from { box-shadow: inset 0 0 0 1.5px #fff, 0 0 0 0 rgba(255, 255, 255, 0.6); } to { box-shadow: inset 0 0 0 1.5px #fff, 0 0 0 9px rgba(255, 255, 255, 0); } }
@keyframes lv-sheen { to { transform: translateX(101%); } }

.guide-hero .scene-flag { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .scene *, .stage *, .lv-card::after { animation: none !important; transition: none !important; }
}
@media print {
  .scene-replay, .scene-controls, .rw-presets { display: none !important; }
}
