/* Genesys showcase loop. Tokens match the landing page and present.css. */
:root {
  --bg: #121418;
  --bg-2: #0c0e11;
  --surface: #1a1d23;
  --surface-2: #22262e;
  --line: #2a2f38;
  --text: #f4f5f7;
  --muted: #a7adb8;
  --faint: #767d8a;
  --accent: #0a9ea4;
  --accent-2: #3fc0c5;
  --display: 'Space Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg-2); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }

.sc-live { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.sc-live.is-idle, .sc-live.is-idle * { cursor: none !important; }
.sc-stage { position: absolute; inset: 0; }

/* A slow glow behind everything, so even a held frame never looks frozen. */
.sc-ambient { position: absolute; inset: -20%; pointer-events: none; z-index: 0; }
.sc-ambient::before, .sc-ambient::after {
  content: ''; position: absolute; width: 60vw; height: 60vw; border-radius: 50%; will-change: transform;
}
.sc-ambient::before { right: 5%; top: 0; background: radial-gradient(circle, rgba(122, 46, 88, 0.42), rgba(18, 20, 24, 0) 65%); animation: sc-float-a 28s ease-in-out infinite alternate; }
.sc-ambient::after { left: 0; bottom: 0; background: radial-gradient(circle, rgba(10, 158, 164, 0.18), rgba(18, 20, 24, 0) 65%); animation: sc-float-b 34s ease-in-out infinite alternate; }
@keyframes sc-float-a { to { transform: translate3d(-18vw, 14vh, 0) scale(1.15); } }
@keyframes sc-float-b { to { transform: translate3d(22vw, -12vh, 0) scale(1.1); } }

/* progress along the top edge: how far through the current beat */
.sc-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3; background: rgba(255, 255, 255, 0.06); }
.sc-progress-fill { height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0); background: var(--accent); }

/* ── Beats ──────────────────────────────────────────────────────────────── */
.sc-beat {
  position: absolute; inset: 0; z-index: 1; display: grid; align-content: center; gap: clamp(24px, 4vh, 48px);
  padding: clamp(40px, 8vh, 88px) clamp(24px, 5vw, 88px) clamp(64px, 11vh, 110px);
  opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s linear .9s;
}
.sc-beat.is-on { opacity: 1; visibility: visible; transition: opacity .9s ease; z-index: 2; }
.sc-beat--clip { grid-template-columns: minmax(16rem, 4fr) minmax(0, 10fr); align-items: center; gap: clamp(28px, 3vw, 56px); }
.sc-beat--clip:not(.sc-beat--portrait) { padding-left: clamp(24px, 4vw, 72px); padding-right: clamp(20px, 2.5vw, 48px); }
.sc-beat--portrait { grid-template-columns: minmax(18rem, 5fr) minmax(0, 6fr); }
/* Beside a clip, the claim is sized to the column, not the screen, so it holds to two or three lines. */
.sc-beat--clip .sc-claim { font-size: clamp(1.8rem, 2.5vw, 3.1rem); line-height: 1.08; max-width: 18ch; }
.sc-beat--clip .sc-detail { font-size: clamp(1rem, 1.3vw, 1.3rem); }
.sc-text { min-width: 0; }
.sc-eyebrow { margin: 0; display: flex; align-items: center; gap: 12px; font-size: clamp(0.8rem, 1.15vw, 1.05rem); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-2); }
.sc-eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--accent-2); }
.sc-claim { margin: 16px 0 0; font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 3.9vw, 4.1rem); line-height: 1.05; letter-spacing: -0.02em; }
.sc-tag { display: inline-block; margin-left: 14px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 0.3em/1.6 var(--body); letter-spacing: 0.08em; vertical-align: middle; }
.sc-detail { margin: 18px 0 0; font-size: clamp(1rem, 1.5vw, 1.4rem); line-height: 1.45; color: var(--muted); max-width: 34ch; }

/* claim alone: bigger, words rise one after another */
.sc-beat--statement, .sc-beat--close { justify-items: start; }
.sc-beat--statement .sc-text { max-width: 64rem; }
.sc-beat--statement .sc-claim { font-size: clamp(3rem, 7.4vw, 7.6rem); max-width: 16ch; }
.sc-beat--statement .sc-detail { font-size: clamp(1.1rem, 1.9vw, 1.75rem); max-width: 46ch; }
.sc-word { display: inline-block; white-space: pre; }
.sc-mark { width: clamp(64px, 7vw, 104px); height: auto; margin-bottom: 28px; display: block; }

/* step captions keyed to the clip's clock */
.sc-steps { margin: clamp(20px, 3.5vh, 36px) 0 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 32rem; }
.sc-step {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 14px;
  border: 1px solid transparent; color: var(--faint); font-size: clamp(0.9rem, 1.1vw, 1.08rem); line-height: 1.35;
  transition: color .4s, background .4s, border-color .4s, transform .4s;
}
.sc-step-n {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--line); font: 600 0.82rem/1 var(--display); color: var(--faint); transition: all .4s;
}
.sc-step.is-done { color: var(--muted); }
.sc-step.is-done .sc-step-n { border-color: rgba(63, 192, 197, 0.5); color: transparent; background: rgba(10, 158, 164, 0.18); position: relative; }
.sc-step.is-done .sc-step-n::after { content: ''; position: absolute; width: 10px; height: 5px; border-left: 2px solid var(--accent-2); border-bottom: 2px solid var(--accent-2); transform: translateY(-1px) rotate(-45deg); }
.sc-step.is-on { color: var(--text); background: var(--surface); border-color: var(--line); transform: translateX(6px); }
.sc-step.is-on .sc-step-n { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 6px rgba(10, 158, 164, 0.18); }

/* the clip, in a browser frame */
.sc-media { min-width: 0; align-self: center; }
.sc-frame { border-radius: 16px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); background: #f4f2ec; box-shadow: 0 50px 100px -40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.4); }
.sc-frame-bar { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px; background: #1f2532; }
.sc-frame-bar i { width: 10px; height: 10px; border-radius: 50%; }
.sc-frame-bar i:nth-child(1) { background: #e76a5c; } .sc-frame-bar i:nth-child(2) { background: #e9b54a; } .sc-frame-bar i:nth-child(3) { background: #5fbf6a; }
.sc-frame-bar b { margin-left: 12px; height: 18px; padding: 0 10px; border-radius: 6px; background: #2b3140; font: 500 11px/18px var(--body); color: #8e96a6; }
.sc-frame video, .sc-frame img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #f4f2ec; }
.sc-beat--portrait .sc-media { justify-self: center; }
.sc-beat--portrait .sc-frame { width: fit-content; }
.sc-beat--portrait .sc-frame video, .sc-beat--portrait .sc-frame img { width: auto; height: 82vh; max-height: 82vh; max-width: 100%; }
.sc-beat.is-on .sc-frame { animation: sc-frame-in 1.1s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes sc-frame-in { from { opacity: 0; transform: translate3d(0, 24px, 0) scale(.97); } to { opacity: 1; transform: none; } }

.sc-beat.is-on .sc-text > * { animation: sc-rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.sc-beat.is-on .sc-claim { animation-delay: .08s; }
.sc-beat.is-on .sc-detail { animation-delay: .2s; }
.sc-beat.is-on .sc-steps { animation-delay: .32s; }
.sc-beat--statement.is-on .sc-claim, .sc-beat--close.is-on .sc-claim { animation: none; }
.sc-beat.is-on .sc-word { animation: sc-rise .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 90ms + .1s); }
@keyframes sc-rise { from { opacity: 0; transform: translate3d(0, 18px, 0); } to { opacity: 1; transform: none; } }

/* close: address and QR */
.sc-beat--close { grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: stretch; }
.sc-beat--close .sc-claim { font-size: clamp(3.4rem, 8vw, 8rem); }
.sc-qr { justify-self: end; padding: 18px; border-radius: 22px; background: #fff; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8); }
.sc-qr img { display: block; width: clamp(180px, 20vw, 300px); height: auto; }
.sc-beat--close.is-on .sc-qr { animation: sc-frame-in 1.1s .3s cubic-bezier(.2, .7, .2, 1) both; }

/* Pausing holds the clip and the background; entrances always finish, or a beat
   stepped to while paused would freeze on its first, invisible frame. */
.sc-live.is-paused .sc-ambient::before, .sc-live.is-paused .sc-ambient::after { animation-play-state: paused; }

/* corner badge */
.sc-badge { position: absolute; right: clamp(20px, 3vw, 48px); bottom: clamp(18px, 3vh, 34px); z-index: 3; display: flex; align-items: center; gap: 10px; font: 600 0.9rem var(--display); letter-spacing: 0.04em; color: var(--muted); }
.sc-badge img { width: 28px; height: 28px; }
.sc-paused-pill { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); z-index: 4; padding: 6px 14px; border-radius: 999px; background: rgba(12, 14, 17, 0.85); border: 1px solid var(--line); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: none; }
.sc-live.is-paused .sc-paused-pill { display: block; }

/* ── Control bar ────────────────────────────────────────────────────────── */
.sc-bar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 14px; padding: 6px 8px; border-radius: 999px;
  background: rgba(26, 29, 35, 0.94); border: 1px solid var(--line); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  transition: opacity .4s;
}
.sc-bar-group { display: flex; align-items: center; gap: 4px; }
.sc-btn { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 8px 12px; background: transparent; font-size: 0.85rem; font-weight: 500; white-space: nowrap; }
.sc-btn:hover { background: var(--surface-2); }
.sc-btn svg { width: 16px; height: 16px; }
.sc-btn--primary { background: var(--accent); color: #fff; padding: 8px 16px; }
.sc-btn--primary:hover { background: #0bb2b8; }
.sc-count { padding: 0 8px; font-size: 0.85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-live.is-idle .sc-bar { opacity: 0; pointer-events: none; }
.sc-hint { margin-left: 2px; color: var(--muted); }

/* Short screens (720p projectors): a seven-step beat still has to fit. */
@media screen and (min-width: 901px) and (max-height: 820px) {
  .sc-beat { padding-top: 44px; padding-bottom: 76px; }
  .sc-beat--clip .sc-claim { font-size: clamp(1.7rem, 2.5vw, 2.8rem); }
  .sc-detail { margin-top: 12px; }
  .sc-steps { margin-top: 16px; gap: 3px; }
  .sc-step { padding: 6px 12px; }
  .sc-step-n { width: 24px; height: 24px; font-size: 0.75rem; }
  .sc-beat--portrait .sc-frame video, .sc-beat--portrait .sc-frame img { height: 76vh; max-height: 76vh; }
}

/* ── Small screens ──────────────────────────────────────────────────────── */
@media screen and (max-width: 900px) {
  .sc-beat--clip, .sc-beat--portrait { grid-template-columns: 1fr; align-content: start; gap: 18px; padding-top: 44px; }
  .sc-frame video, .sc-frame img { max-height: 40vh; }
  .sc-beat--portrait .sc-frame video, .sc-beat--portrait .sc-frame img { height: 44vh; }
  .sc-steps { display: none; }
  .sc-beat--close { grid-template-columns: 1fr; }
  .sc-qr { justify-self: start; }
  .sc-bar { gap: 2px; max-width: calc(100% - 16px); }
  .sc-count, .sc-hint, .sc-btn-label { display: none; }
  .sc-badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-beat { transition: none; }
  .sc-beat.is-on *, .sc-ambient::before, .sc-ambient::after { animation: none !important; }
}
