/* Sales page and demo stage. Deliberately light-only (sunday's own neutral palette). */

:root {
  --ink: #111;
  --muted: rgba(0, 0, 0, 0.58);
  --line: rgba(0, 0, 0, 0.1);
  --soft: rgba(0, 0, 0, 0.04);
  --bg: #f4f4f5;
  --stage: #1b1b1d;
  --accent: #000;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.is-demo { background: var(--stage); }
body.is-demo #app { height: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid #000; outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 14px; cursor: pointer; background: var(--soft); text-decoration: none; white-space: nowrap; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--ghost { background: #fff; border: 1px solid var(--line); }

/* sales page */
/* Helvetica Neue where the device has it (Apple), Inter otherwise; only Regular (400) and Medium (500). */
.is-sales { --brand: #ff17e9; --brand-soft: rgba(255, 23, 233, 0.08); --display: 'Helvetica Neue', Helvetica, Inter, Arial, sans-serif; font-family: var(--display); }
.is-sales strong, .is-sales .btn, .is-sales .pill { font-weight: 500; }
.sales { max-width: 880px; margin: 0 auto; padding-block: 40px 64px; padding-inline: 16px; display: flex; flex-direction: column; gap: 40px; }
.sales-head { display: flex; flex-direction: column; gap: 12px; }
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.brand-logo { display: block; width: 126px; height: 32px; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; vertical-align: middle; }
.pill--beta { background: var(--brand-soft); color: #b0009f; }
.sales-head h1 { margin: 0; max-width: 16ch; font-size: clamp(36px, 7vw, 60px); font-weight: 500; line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
.lead { margin: 0; max-width: 60ch; color: var(--muted); font-size: 16px; line-height: 1.55; }
.v0-note { margin: 4px 0 0; max-width: 64ch; padding: 12px 16px; border-left: 3px solid var(--brand); background: #fff; border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.5; }
.market h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.demo-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.demo-row { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.demo-row:last-child { border-bottom: 0; }
.demo-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.demo-name { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.demo-tagline { font-size: 14px; }
.demo-desc { color: var(--muted); font-size: 14px; line-height: 1.45; }
.demo-link { width: 100%; margin-top: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 12px; color: var(--muted); text-overflow: ellipsis; }
.demo-actions { display: flex; gap: 8px; }
.demo-row--soon { background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(0, 0, 0, 0.018) 10px 20px); border-radius: 0 0 16px 16px; }
.demo-row--soon .demo-name, .demo-row--soon .demo-tagline { color: var(--muted); }
.sales-foot { margin: 0; max-width: 70ch; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sales-foot a { color: var(--ink); text-decoration-color: var(--brand); text-underline-offset: 3px; }
@media (max-width: 680px) {
  .demo-row { flex-direction: column; align-items: stretch; }
  .demo-actions .btn { flex: 1; }
}

/* QR code card preview */
.qr-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
.qr-dialog::backdrop { background: rgba(17, 17, 17, 0.45); }
.qr-body { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.qr-body h3 { margin: 0; font-size: 16px; font-weight: 500; }
.qr-preview { display: block; width: 100%; aspect-ratio: 4 / 5; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); object-fit: contain; }
.qr-actions { display: flex; gap: 8px; justify-content: flex-end; }
.qr-actions .btn { flex: 1; }
.qr-status { margin: 0; min-height: 1em; color: var(--muted); font-size: 13px; }
.qr-status:empty { display: none; }

/* demo stage: an iPhone 17 frame on a computer, edge to edge on a phone */
.stage { height: 100%; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; }
.phone-slot { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
/* iPhone 17: 402×874 pt screen inside an 8px bezel; scaled as a whole by fitPhone(). */
.phone { flex: none; box-sizing: content-box; width: 402px; height: 874px; padding: 8px; border-radius: 63px; background: #111; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); transform-origin: center; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 55px; overflow: hidden; background: #fff; }
.restart { padding: 8px 16px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
@media (max-width: 500px) {
  .stage { padding: 0; gap: 0; min-height: 100vh; min-height: 100dvh; }
  .phone-slot { display: block; }
  /* Pinned to the visible screen, so the demo never grows with its content (the host page may not
     give it a height): the bill scrolls inside and the pay button and legal copy stay in view. */
  .phone { position: fixed; inset: 0; width: auto; height: auto; padding: 0; border-radius: 0; box-shadow: none; }
  .phone-screen { border-radius: 0; }
  /* The visitor's real phone already has a status bar. */
  .phone-screen .pat-status { display: none; }
  .phone-screen .pat-urlbar { display: none; }
  .phone-screen .pat { --urlbar: 0px; }
  .restart { display: none; }
}

.market h2 .flag { width: 28px; height: 20px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }

.stage-actions { display: flex; gap: 8px; }

/* Owners only: floating "All demos" button on every demo (see syncOwnerBack in main.js) */
.owner-back { position: fixed; left: 12px; bottom: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 2147483000; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 14px 0 8px; border: 0; border-radius: 999px; background: #ffe58a; color: #5a4300; font: 600 13px/1 Inter, system-ui, sans-serif; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); cursor: pointer; opacity: 0.92; }
.owner-back:hover { opacity: 1; }
@media (max-width: 640px) {
  /* Phone: a small round button on the left edge, clear of the bottom buttons */
  .owner-back { bottom: auto; top: 50%; left: 0; height: 40px; width: 32px; padding: 0 0 0 6px; border-radius: 0 999px 999px 0; transform: translateY(-50%); }
  .owner-back span { display: none; }
}
@media (min-width: 641px) and (max-width: 899px) {
  /* Site demos on an iPad: stay above the basket bar. */
  body.is-catering .owner-back { bottom: 92px; }
}
