/* SkyRender Sync demo — self-contained styles (tokens + shared classes scoped to
   #skyrender-sync so they can't clash with the host site, then the demo CSS). */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');
#skyrender-sync{
  --bg:#06080c; --bg-2:#090c13; --bg-3:#0c1019;
  --ink:#eef2f7; --ink-2:#c4ccd6; --ink-dim:#939dac; --ink-faint:#5c6573;
  --line:rgba(255,255,255,0.085); --line-soft:rgba(255,255,255,0.05); --line-2:rgba(255,255,255,0.14);
  --cyan:#2fe7e0; --cyan-2:#3df0e9;
  --grad:linear-gradient(100deg,#26d8e6 0%,#8b5cf6 52%,#ec4899 100%);
  --ease:cubic-bezier(.2,.7,.2,1);
  --font-d:"Space Grotesk","Helvetica Neue",Helvetica,Arial,sans-serif;
  --font-m:"JetBrains Mono",ui-monospace,"SFMono-Regular",Menlo,monospace;
  color:var(--ink); font-family:var(--font-d);
}
/* The demo's layout + the phone-preview scale math were authored against a
   global `box-sizing: border-box` (the homepage gets it from base.css). The
   embed loads no base.css — and in the sandboxed iframe (frame.html) there is
   no host reset at all — so establish it here, or borders/padding (esp. the
   8px phone-frame border) fall outside the declared width and the scaled client
   no longer fills the frame (black margin on the right + bottom). */
#skyrender-sync, #skyrender-sync *, #skyrender-sync *::before, #skyrender-sync *::after { box-sizing: border-box; }
#skyrender-sync .eyebrow{ font-family:var(--font-m); font-size:12px; font-weight:500; letter-spacing:.34em; text-transform:uppercase; white-space:nowrap; color:var(--cyan); display:inline-flex; align-items:center; gap:10px; }
#skyrender-sync .eyebrow::before{ content:""; width:22px; height:1px; background:currentColor; opacity:.7; }
#skyrender-sync .grad-text{ background:var(--grad); -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; }
#skyrender-sync .btn{ display:inline-flex; align-items:center; justify-content:center; gap:10px; font-family:var(--font-d); font-weight:500; font-size:15px; letter-spacing:-0.01em; padding:13px 22px; border-radius:999px; border:1px solid transparent; transition:transform .25s var(--ease),background .25s,border-color .25s,box-shadow .25s; white-space:nowrap; cursor:pointer; }
#skyrender-sync .btn:active{ transform:translateY(1px); }
#skyrender-sync .btn:disabled{ opacity:.55; cursor:default; }
#skyrender-sync .btn-cyan{ background:var(--cyan); color:#04201e; font-weight:600; }
#skyrender-sync .btn-cyan:hover{ background:var(--cyan-2); transform:translateY(-2px); box-shadow:0 14px 34px -14px rgba(47,231,224,.7); }
#skyrender-sync .btn-line{ background:transparent; color:var(--ink-2); border-color:var(--line); }
#skyrender-sync .btn-line:hover{ color:var(--ink); border-color:var(--line-2); }
#skyrender-sync .btn-lg{ padding:16px 28px; font-size:16px; }

/* "Try it live" SkyRender Sync demo (homepage, after the Sync section). */

.sd-block { padding: clamp(36px, 6vw, 72px) 0; position: relative; scroll-margin-top: 80px; }
.sd-intro { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.sd-intro .eyebrow { justify-content: center; }
.sd-h2 {
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-top: 10px;
}
.sd-sub { margin-top: 16px; font-size: 16px; line-height: 1.6; color: var(--ink-2, #b9c2cc); }

.sd-grid {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 24px;
  align-items: stretch;
  max-width: 960px;
  margin: 0 auto;
}
/* 3-column variant: QR · big phone · crowd of 8 example phones on the right. */
.sd-grid3 {
  grid-template-columns: minmax(190px, 260px) minmax(0, 1fr) minmax(160px, 200px);
  max-width: 1140px;
  align-items: start;
}

/* QR card */
.sd-qr-card {
  background: var(--bg-2, #090c13);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 20px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.sd-qr {
  width: 200px;
  height: 200px;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 0 40px rgba(60, 224, 230, 0.14);
}
.sd-qr-url {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan, #3ce0e6);
  letter-spacing: 0.02em;
}
.sd-qr-txt p { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--ink-dim, #8a95a1); }
.sd-openbtn { width: 100%; justify-content: center; font-size: 13.5px; }

/* Demo player */
.sd-player {
  background: var(--bg-2, #090c13);
  border: 1px solid var(--line, rgba(255,255,255,0.08));
  border-radius: 20px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.sd-player.live { border-color: rgba(60, 224, 230, 0.4); box-shadow: 0 0 50px rgba(60, 224, 230, 0.1); }
.sd-player-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sd-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-dim, #8a95a1);
  border: 1px solid var(--line, rgba(255,255,255,0.1));
  border-radius: 999px;
  padding: 5px 12px;
}
.sd-badge.live { color: #3ce0e6; border-color: rgba(60,224,230,0.4); animation: sd-pulse 1.4s ease-in-out infinite; }
@keyframes sd-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.sd-timer { font-family: "JetBrains Mono", monospace; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink, #eaf2f4); }

/* Embedded live guest view — the REAL audience client (csqr.io/<slug>?preview=1)
   inside a phone frame. The client is built for a ~393px phone viewport, so we
   render it at that true size and CSS-scale the whole thing down to fit the
   frame — everything stays proportional instead of overflowing/clipping. */
.sd-livewrap { display: flex; flex-direction: column; align-items: center; gap: 13px; margin: 22px auto 18px; }
.sd-liveframe {
  position: relative;
  width: 200px;
  height: 406px;
  border-radius: 32px;
  background: #05070c;
  border: 8px solid #12161e;
  box-shadow: 0 22px 58px -22px rgba(0,0,0,0.78), 0 0 42px rgba(43,212,192,0.13), inset 0 0 0 1px rgba(255,255,255,0.05);
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
/* Notch for phone realism (sits above the scaled client). */
.sd-liveframe-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 78px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  z-index: 2;
  pointer-events: none;
}
.sd-liveframe-scale {
  position: absolute;
  top: 0;
  left: 0;
  width: 393px;      /* visible phone viewport (maps to the 184px frame width) */
  height: 834px;
  transform: scale(0.468);   /* 184px inner width / 393px viewport */
  transform-origin: top left;
  overflow: hidden;  /* clip the iframe's own scrollbar (it sits past 393px below) */
}
/* The client's vertical scrollbar can't be styled cross-origin, so the iframe is
   made ~22px wider than the visible window; the scale wrapper's overflow:hidden
   crops that strip (which holds the scrollbar) out of view. */
.sd-liveiframe { width: 415px; height: 834px; border: 0; display: block; background: #06090f; }
.sd-liveframe-load {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 18px;
  font-size: 13px;
  color: var(--ink-dim, #8a95a1);
  background: radial-gradient(80% 55% at 50% 30%, rgba(43,212,192,0.10), transparent 60%), #06090f;
}
.sd-livecap { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-dim, #8a95a1); }
.sd-livedot { width: 7px; height: 7px; border-radius: 50%; background: #3ce0e6; box-shadow: 0 0 8px rgba(60,224,230,0.9); animation: sd-pulse 1.4s ease-in-out infinite; flex-shrink: 0; }
.sd-player.live .sd-liveframe { border-color: rgba(43,212,192,0.35); box-shadow: 0 24px 64px -22px rgba(0,0,0,0.78), 0 0 64px rgba(43,212,192,0.24), inset 0 0 0 1px rgba(255,255,255,0.06); }

.sd-note { font-size: 14px; line-height: 1.55; color: var(--ink-dim, #8a95a1); min-height: 42px; }
.sd-actions { margin-top: 16px; }
.sd-actions .btn { width: 100%; justify-content: center; }
.sd-start { font-size: 16px; }
/* Restart + Stop side by side while the show runs. */
.sd-btnrow { display: flex; gap: 12px; }
.sd-btnrow .btn { flex: 1; width: auto; }
.sd-stop { color: rgba(255, 138, 138, 0.9); border-color: rgba(255, 122, 122, 0.4); }
.sd-stop:hover { border-color: rgba(255, 122, 122, 0.7); background: rgba(255, 122, 122, 0.08); }

/* Crowd — 8 phones, a synchronized audience looping the REAL example cue
   sequence (raise-phones wave → flash → unify → rainbow → strobe → fade → soft
   flash), with a live chip naming the current cue. */
/* Crowd — the 3rd grid column: a compact 2×4 block of example phones beside the
   big preview phone, with a stacked header + live cue chip above. */
.sd-crowd {
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.sd-crowd-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  margin-bottom: 2px;
}
.sd-crowd-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim, #8a95a1);
}
.sd-crowd-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-dim, #8a95a1);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 13px;
  min-width: 0;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.sd-crowd-cue.on {
  color: #eaf2f4;
  background: rgba(60, 224, 230, 0.1);
  border-color: rgba(60, 224, 230, 0.45);
}
.sd-crowd-cue .sd-livedot { opacity: 0.4; }
.sd-crowd-cue.on .sd-livedot { opacity: 1; }
.sd-crowd-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  justify-items: stretch;
  width: 90%;
}
.sd-crowd .sd-tile-phone { max-width: none; width: 100%; }
.sd-tile-phone {
  width: 100%;
  max-width: 68px;
  aspect-ratio: 52 / 106;
  border-radius: 13px;
  background: #05070c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.6);
}
.sd-tile-screen {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: #05070c;
  transition: background 0.04s linear, box-shadow 0.04s linear, opacity 0.04s linear;
}

@media (max-width: 940px) {
  .sd-grid, .sd-grid3 { grid-template-columns: 1fr; max-width: 520px; }
  .sd-crowd { margin-top: 12px; }
  .sd-crowd-row { grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2vw, 16px); row-gap: 20px; }
  .sd-crowd .sd-tile-phone { max-width: 62px; }
}

/* --- Defense against host-site CSS bleed (inline / Option-B embed) ----------
   The live-preview phone is a fixed-pixel scaled iframe. A partner site's
   global responsive reset (e.g. `img, iframe, video { max-width:100%;
   height:auto }` or `iframe { width:100% }`) can override these exact
   dimensions and cut the preview off — the "half black phone" symptom. Re-pin
   every dimension the scale math depends on, scoped under #skyrender-sync and
   !important, so host resets can't win regardless of their specificity.
   (The auto-resizing iframe embed — Option A — avoids all of this by rendering
   the demo in its own sandboxed document.) */
#skyrender-sync .sd-liveframe {
  width: 200px !important; height: 406px !important;
  max-width: none !important; box-sizing: border-box !important;
}
#skyrender-sync .sd-liveframe-scale {
  width: 393px !important; height: 834px !important;
  max-width: none !important; min-width: 0 !important;
  box-sizing: border-box !important;
  transform: scale(0.468) !important; transform-origin: top left !important;
}
#skyrender-sync .sd-liveiframe {
  width: 415px !important; height: 834px !important;
  max-width: none !important; min-width: 415px !important;
  box-sizing: border-box !important;
}
#skyrender-sync .sd-qr { max-width: none !important; box-sizing: border-box !important; }
#skyrender-sync .sd-tile-phone, #skyrender-sync .sd-tile-screen { max-width: none !important; box-sizing: border-box !important; }

/* Device-aware step-by-step instructions (mobile vs desktop) — mirrors sync-demo.css. */
.sd-steps { list-style: none; margin: 22px auto 0; padding: 0; max-width: 540px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.sd-steps li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.5; color: var(--ink-2, #c4ccd6); }
.sd-step-n { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 700; color: var(--cyan, #3ce0e6); background: rgba(60, 224, 230, 0.1); border: 1px solid rgba(60, 224, 230, 0.4); }
.sd-steps b { color: var(--ink, #eef2f7); font-weight: 600; }
