/* Landing: the live demo (#demo). Two devices driven by one step machine: the customer's phone and the cashier's
   tablet. One brand skin only (the product has no sector skins). No inline styles: CSP style-src 'self'. */

.demo { padding-block: 124px 8px; background: var(--paper); } /* top clears the hero phone that hangs over (as .land-how did); .land-how keeps its own 120px top */
.demo-head { max-inline-size: 760px; margin-inline: auto; text-align: center; }
.demo-lede { margin: 10px 0 0; color: var(--ink-2); font-size: 19px; line-height: var(--lh-body); }

.demo .band, .demo .btn-primary { transition: background-color 380ms var(--ease), color 380ms var(--ease), box-shadow 380ms var(--ease); }

/* controls */
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 18px; margin-block: 32px 18px; }
.demo-name { display: inline-flex; align-items: center; gap: 10px; padding: 5px 5px 5px 16px; padding-inline-start: 18px; border-radius: var(--radius-chip); background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-card); font-size: var(--fs-meta); font-weight: var(--w-ui); color: var(--ink-2); }
.demo-name input { inline-size: 170px; min-block-size: 40px; padding-inline: 14px; border: 0; border-radius: var(--radius-chip); background: var(--paper-2); color: var(--ink); font: inherit; font-size: 16px; font-weight: var(--w-ui); }
.demo-name input:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.demo-toggles { display: inline-flex; gap: 8px; }
.demo-tog { display: inline-flex; align-items: center; gap: 8px; min-block-size: 46px; padding-inline: 16px; border: 0; border-radius: var(--radius-chip); background: var(--card); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font: inherit; font-size: var(--fs-meta); font-weight: var(--w-ui); cursor: pointer; }
.demo-tog::before { content: ""; inline-size: 34px; block-size: 20px; border-radius: 999px; background: var(--line-2); box-shadow: inset -14px 0 0 2px var(--line-2), inset -14px 0 0 4px var(--white); transition: box-shadow var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.demo-tog[aria-pressed="true"] { color: var(--ink); }
.demo-tog[aria-pressed="true"]::before { background: var(--red); box-shadow: inset 14px 0 0 2px var(--red), inset 14px 0 0 4px var(--white); }

/* step rail */
.demo-steps { display: flex; justify-content: center; gap: 10px; margin: 0 0 28px; padding: 0; list-style: none; counter-reset: ds; }
.demo-steps li { counter-increment: ds; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 18px; border-radius: var(--radius-chip); background: var(--paper-2); color: var(--ink-2); font-size: var(--fs-meta); font-weight: var(--w-ui); transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.demo-steps li::before { content: counter(ds); display: grid; place-items: center; inline-size: 26px; block-size: 26px; border-radius: 50%; background: var(--card); color: var(--ink); font-weight: var(--w-num); font-size: 14px; }
.demo-steps li.is-now { background: var(--red); color: var(--on-red); }
.demo-steps li.is-now::before { color: var(--red); }
.demo-steps li.is-done { background: var(--ready-tint); color: var(--ready); }
.demo-steps li.is-done::before { content: "✓"; background: var(--ready); color: var(--ready-ink); }

/* stage */
.demo-stage { display: flex; align-items: center; justify-content: center; gap: 0; }
.demo-wire { position: relative; flex: none; inline-size: 88px; block-size: 4px; margin-inline: 6px; border-radius: 2px; background-image: linear-gradient(90deg, var(--line-2) 50%, transparent 50%); background-size: 12px 4px; }
.demo-wire::after { content: ""; position: absolute; inset-block-start: 50%; inset-inline-end: 0; inline-size: 14px; block-size: 14px; margin-block-start: -7px; border-radius: 50%; background: var(--red); opacity: 0; }
.demo-wire.is-sending::after { animation: demo-wire 520ms var(--ease) 2; }
.demo-wire.is-ready::after { background: var(--ready); }

/* the phone */
.dphone { position: relative; flex: none; inline-size: 300px; block-size: 612px; padding: 12px; border-radius: 48px; background: var(--device-body); box-shadow: 0 40px 70px -34px var(--device-drop), inset 0 0 0 2px var(--puck-rim), inset 0 0 0 4px var(--device-body), inset 0 0 0 5px var(--puck-hi); }
.dphone.is-ringing { animation: demo-shake 90ms ease-in-out 8; }
.dscreen { position: relative; overflow: hidden; block-size: 100%; border-radius: 37px; background: var(--paper); }
.dnotch { position: absolute; z-index: 9; inset-block-start: 10px; inset-inline-start: 50%; inline-size: 96px; block-size: 28px; margin-inline-start: -48px; border-radius: 999px; background: var(--device-body); }
.dview { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity 260ms var(--ease), visibility 0s linear 260ms; }
.dview.is-on { opacity: 1; visibility: visible; transition: opacity 260ms var(--ease); }
.dview .band { padding-block: 54px 74px; text-align: center; } /* the bottom 60px is where the puck / code tile overlaps */
.dview-venue { margin: 0; font-size: 21px; font-weight: var(--w-display); line-height: 1.3; }
.dview-tag { margin: 4px 0 0; font-size: 14px; font-weight: var(--w-ui); }
.dview-body { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 20px 22px; text-align: center; }
.dview-h { margin: 6px 0 0; font-size: 22px; font-weight: var(--w-display); line-height: 1.35; color: var(--ink); }
.dview-p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.dview .puck { --puck-size: 168px; margin-block-start: -58px; }
.dview-ok { display: inline-flex; align-items: center; gap: 6px; margin-block-start: auto; padding: 6px 12px; border-radius: var(--radius-chip); background: var(--ready-tint); color: var(--ready); font-size: 13px; font-weight: var(--w-ui); }
.dview .btn { min-block-size: 56px; font-size: 18px; margin-block-start: auto; }

/* view: camera */
.dcam { background: var(--cam-bg); color: var(--puck-ink); align-items: center; justify-content: center; gap: 22px; padding: 40px 26px; text-align: center; cursor: pointer; }
.dcam-frame { position: relative; display: grid; place-items: center; inline-size: 196px; block-size: 196px; border-radius: 22px; background: var(--white); box-shadow: 0 0 0 10px var(--cam-halo); }
.dcam-frame svg { inline-size: 150px; block-size: 150px; }
.dcam-frame path { fill: var(--ink); }
.dcam-frame::before { content: ""; position: absolute; inset: -18px; border-radius: 30px; border: 3px solid var(--led-wait); clip-path: polygon(0 0, 28% 0, 28% 6%, 6% 6%, 6% 28%, 0 28%, 0 72%, 6% 72%, 6% 94%, 28% 94%, 28% 100%, 72% 100%, 72% 94%, 94% 94%, 94% 72%, 100% 72%, 100% 28%, 94% 28%, 94% 6%, 72% 6%, 72% 0, 100% 0, 100% 100%, 0 100%); }
.dcam-frame::after { content: ""; position: absolute; inset-inline: 8px; inset-block-start: 8px; block-size: 3px; border-radius: 2px; background: var(--led-wait); box-shadow: 0 0 14px var(--led-wait); animation: demo-scan 1.8s ease-in-out infinite alternate; }
.dcam-sticker { margin: 0; font-size: 13px; font-weight: var(--w-ui); color: var(--puck-ink-2); }
.dcam-h { margin: 0; font-size: 20px; font-weight: var(--w-display); line-height: 1.4; }

/* view: pairing code */
.dcode { display: grid; place-items: center; inline-size: 150px; block-size: 150px; margin-block-start: -60px; border-radius: 34px; background: var(--card); box-shadow: var(--shadow-card-lift), inset 0 0 0 2px var(--red-tint); }
.dcode b { font-size: 76px; font-weight: var(--w-num); line-height: 1; color: var(--red); font-variant-numeric: tabular-nums; }
.dcode small { display: block; margin-block-end: 2px; font-size: 13px; font-weight: var(--w-ui); color: var(--ink-2); }
.dcode { position: relative; padding-block-start: 8px; } /* positioned, or the (positioned) band above paints over its top */


/* the till (tablet) */
.dtill { flex: none; inline-size: 620px; border-radius: 34px; padding: 12px; background: var(--device-body); box-shadow: 0 40px 70px -34px var(--device-drop), inset 0 0 0 2px var(--puck-rim); }
.dtill-screen { overflow: hidden; border-radius: 24px; background: var(--paper); }
.dtill .band--bar { min-block-size: 58px; padding-block: 8px; }
.dtill-venue { flex: 1; font-size: 18px; font-weight: var(--w-display); }
.dtill-live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--radius-chip); background: var(--on-red-ghost); font-size: 13px; font-weight: var(--w-ui); }
.dtill-live::before { content: ""; inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--live-dot); }
.dtill-body { display: grid; grid-template-columns: 1fr 236px; gap: 16px; min-block-size: 404px; padding: 16px; }
.dtill h3 { margin: 0 0 10px; font-size: 15px; font-weight: var(--w-display); color: var(--ink); }
.dtill-col { display: flex; flex-direction: column; min-inline-size: 0; }
.dtill-empty { display: grid; place-items: center; min-block-size: 76px; margin: 0; border-radius: 18px; background: var(--paper-2); color: var(--ink-2); font-size: 14px; font-weight: var(--w-ui); }
.dtill-scan { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow-card), 0 0 0 3px var(--red); animation: demo-arrive 900ms var(--ease) 2; }
.dtill-scan[hidden], .dtill-order[hidden], .dtill-empty[hidden] { display: none; }
.dtill-code { display: grid; place-items: center; flex: none; inline-size: 54px; block-size: 54px; border-radius: 16px; background: var(--red); color: var(--on-red); font-size: 26px; font-weight: var(--w-num); font-variant-numeric: tabular-nums; }
.dtill-scan p { margin: 0; font-size: 15px; font-weight: var(--w-display); line-height: 1.4; color: var(--ink); }
.dtill-scan small { display: block; font-size: 13px; font-weight: var(--w-ui); color: var(--ink-2); }
.dtill-orders { margin-block-start: 18px; }
.dtill-order { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow-card); transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.dtill-order .puck { --puck-size: 54px; }
.dtill-order .puck .puck-label { display: none; }
.dtill-onum { flex: 1; font-size: 30px; font-weight: var(--w-num); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.dtill-onum small { display: block; margin-block-start: 4px; font-size: 13px; font-weight: var(--w-ui); color: var(--ink-2); }
.dtill-order .btn { min-block-size: 54px; padding-inline: 22px; font-size: 18px; }
.demo[data-step="2"] .dtill-ready { animation: demo-nudge 1.4s var(--ease) infinite; }
.demo[data-step="3"] .dtill-order { background: var(--ready-tint); box-shadow: 0 0 0 2px var(--ready); }
.demo[data-step="3"] .dtill-ready[disabled] { opacity: 1; background: transparent; color: var(--ready); box-shadow: none; }
.dtill-display { display: flex; align-items: center; justify-content: center; min-block-size: 58px; margin-block-end: 10px; border-radius: 16px; background: var(--puck); color: var(--puck-ink); font-size: 30px; font-weight: var(--w-num); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; direction: ltr; }
.dtill-display.is-empty { color: var(--puck-ink-2); font-size: 15px; font-weight: var(--w-ui); letter-spacing: 0; direction: rtl; }
.dtill-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.dtill-keys button { min-block-size: 46px; border: 0; border-radius: 13px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-key); font: inherit; font-size: 20px; font-weight: var(--w-num); cursor: pointer; }
.dtill-keys button:active, .dtill-keys button.is-hit { transform: translateY(1px); box-shadow: var(--shadow-key-press); background: var(--red-tint); }
.dtill-keys button:disabled { opacity: 0.45; cursor: default; }
.dtill-bind { min-block-size: 52px; margin-block-start: 10px; font-size: 16px; }

/* guide */
.demo-guide { display: flex; flex-direction: column; align-items: center; gap: 14px; max-inline-size: 760px; margin: 30px auto 0; text-align: center; }
.demo-say { margin: 0; font-size: 21px; font-weight: var(--w-display); line-height: 1.5; color: var(--ink); }
.demo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.demo-actions .btn-primary { min-inline-size: 240px; }
.demo-actions [hidden] { display: none; }
.demo-note { margin: 0; font-size: 13px; color: var(--ink-2); }

@keyframes demo-scan { from { transform: translateY(0); } to { transform: translateY(176px); } }
@keyframes demo-arrive { 0% { box-shadow: var(--shadow-card), 0 0 0 3px var(--red); } 50% { box-shadow: var(--shadow-card), 0 0 0 9px var(--red-tint); } 100% { box-shadow: var(--shadow-card), 0 0 0 3px var(--red); } }
@keyframes demo-nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-3px); } 90% { transform: translateY(1px); } }
@keyframes demo-wire { from { inset-inline-end: 0; opacity: 1; } to { inset-inline-end: calc(100% - 14px); opacity: 0.9; } }
@keyframes demo-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2.2deg) translateX(-2px); } 75% { transform: rotate(2.2deg) translateX(2px); } }

@media (max-width: 1080px) {
  .demo-stage { flex-direction: column; gap: 22px; }
  .demo-wire { inline-size: 4px; block-size: 44px; margin: 0; background-image: linear-gradient(180deg, var(--line-2) 50%, transparent 50%); background-size: 4px 12px; }
  .demo-wire::after { display: none; }
}
@media (max-width: 680px) {
  .demo { padding-block: 84px 8px; }
  .demo-name > span { white-space: nowrap; }
  .demo-steps { flex-wrap: wrap; }
  .demo-name { inline-size: 100%; justify-content: space-between; }
  .demo-name input { inline-size: 100%; }
  .dtill { inline-size: 100%; border-radius: 26px; padding: 8px; }
  .dtill-body { grid-template-columns: 1fr; min-block-size: 0; }
  .demo-guide { position: sticky; inset-block-end: 12px; z-index: 5; padding: 14px; border-radius: 24px; background: var(--demo-float-bg); box-shadow: 0 18px 40px -18px var(--demo-float-shadow); }
  .demo-say { font-size: 17px; }
  .demo-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dphone.is-ringing, .demo[data-step="2"] .dtill-ready, .dtill-scan, .dcam-frame::after, .demo-wire.is-sending::after { animation: none; }
}
