/* crmmaps.com/demo: the narrated demo video. Loads after styles.css and reuses its tokens, header, sign-up form and
   footer.
   One centred column, built like a video sales letter: the headline, one line, the video, then the early-access form
   right under it and Sector Growth's done-for-you setup as the quieter second way in. The video sits in a raised frame
   like the home page's map. Before it plays, a dark scrim dims the poster and a big white raised disc with a label
   says what it is; a soft green glow breathes behind the disc while it waits.
   With JavaScript, demo.js lays the video's own colours behind the frame and, at the cue times in the video facts
   block (demo.html), leads the eye from the video down to the form. Reduced motion and forced colours turn that off,
   and without JavaScript none of it exists and the native player just works. */

/* Secondary text meets AA on this page (the shared #77819A is about 3.4:1 on paper). 16px gutters on a phone. */
:root { --ink-3: #5A6480; --gutter: clamp(16px, 4vw, 48px); --sg-blue: #174FA2; --sg-blue-2: #0F3D80; }

/* The column. Its paper background is what the video's colours blend into (multiply), and it clips sideways so the
   glows can never make a phone scroll horizontally (clip makes no scroll box; hidden is the fallback). */
.demo {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 1400px; margin: 0 auto; padding: clamp(4px, 1.2vw, 14px) var(--gutter) clamp(64px, 8vw, 104px);
  background: var(--paper);
  overflow-x: hidden; overflow-x: clip;
}
/* Two lines on a laptop, so the headline, the line, the video and the form all fit the first screen at 1440x900. */
.demo h1 {
  margin: 0; max-width: 980px; text-wrap: balance;
  font-stretch: 118%; font-size: clamp(2.05rem, 3.6vw, 3.25rem); line-height: 1;
}
.demo-sub { margin: clamp(12px, 1.3vw, 16px) 0 0; max-width: 780px; text-wrap: balance; font-size: clamp(1.02rem, 1.3vw, 1.14rem); }

/* ---------- The video: a raised frame like the home page's map ---------- */
.demo-frame {
  position: relative;
  width: 100%; max-width: 820px; aspect-ratio: 16 / 9; margin-top: clamp(20px, 2.4vw, 28px);
  border-radius: var(--r-lg);
}
/* A soft green glow behind the frame, breathing slowly. demo.js swaps it for the video's own colours. */
.demo-frame::before {
  content: ""; position: absolute; inset: -9% -6%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 221, 81, .26), rgba(0, 221, 81, .08) 62%, transparent);
  filter: blur(18px); pointer-events: none;
  animation: demo-glow 9s ease-in-out infinite alternate;
}
.demo-clip {
  position: absolute; inset: 0; overflow: hidden;
  border: var(--edge); border-radius: inherit; box-shadow: 0 8px 0 0 var(--base);
  background: var(--paper-2);
}
.demo-video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--paper-2); }
.demo-video:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; border-radius: 0; }

/* The play button: the whole poster. Shown only once the inline script has taken the native controls away
   (data-state="idle"), and gone once the video starts; the native controls carry pause and replay from there.
   A dark scrim (darkest in the middle) brings the button forward, a big white disc with a solid navy triangle sits
   on the site's raised base edge, and the label under it is the button's accessible name, so a voice user can say
   what they see. */
.demo-play {
  position: absolute; inset: 0; z-index: 3;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  margin: 0; padding: 0; border: 0; border-radius: inherit; background: transparent;
  color: var(--base); font: inherit; cursor: pointer;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.demo-frame[data-state="idle"] .demo-play { display: flex; }
.demo-play::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 75% at 50% 50%, rgba(2, 10, 46, .64), rgba(2, 10, 46, .42) 70%, rgba(2, 10, 46, .3));
  transition: opacity .2s ease;
}
/* The disc is its own layer: the glow (::before) under the white face (::after) under the triangle. */
.demo-disc {
  position: relative; isolation: isolate; display: grid; place-items: center;
  width: 76px; height: 76px;
  transition: transform .08s ease;
}
.demo-disc::before, .demo-disc::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.demo-disc::before {
  inset: -26px;
  background: radial-gradient(closest-side, rgba(0, 221, 81, .62), rgba(0, 221, 81, .2) 62%, transparent);
  animation: demo-play-glow 2.8s ease-in-out infinite alternate;
}
.demo-disc::after {
  inset: 0; background: #fff; border: var(--edge);
  box-shadow: 0 5px 0 0 var(--base), 0 18px 36px -12px rgba(2, 10, 46, .8);
  transition: box-shadow .08s ease, background-color .15s ease;
}
.demo-disc svg { width: 34px; height: 34px; margin-left: 4px; fill: currentColor; } /* the triangle's visual centre */
.demo-label {
  position: relative; padding: 7px 14px; border-radius: 999px;
  background: rgba(2, 10, 46, .82); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
  color: #fff; font-weight: 680; font-size: .95rem; line-height: 1.2; white-space: nowrap;
}
/* Pressed: the disc sinks onto its base edge, like every raised button on the site. */
.demo-play:active .demo-disc { transform: translateY(4px); }
.demo-play:active .demo-disc::after { box-shadow: 0 1px 0 0 var(--base), 0 10px 24px -12px rgba(2, 10, 46, .8); }
.demo-play:focus-visible { outline: 3px solid var(--green-ink); outline-offset: 4px; }
.demo-play:focus-visible .demo-disc::after { box-shadow: 0 5px 0 0 var(--base), 0 0 0 4px #fff, 0 0 0 7px var(--green-ink); }

/* ---------- Early access, right under the video ---------- */
.demo-cta { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: clamp(30px, 3.4vw, 40px); }
.demo-cta .signup { width: 100%; justify-content: center; }
.demo-cta .signup input[type="email"] { background: #fff; }
.demo-cta .form-msg { text-align: center; }
.demo-cta .consent { max-width: 46ch; margin-inline: auto; }
.demo-cta .form-msg:empty { min-height: 0; margin-top: -10px; }
.demo-note { margin-top: 10px; max-width: 46ch; color: var(--ink-2); font-size: .92rem; }

/* Done for you: Sector Growth's logo and one link, quieter than the form. */
.demo-dfy {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  max-width: 560px; color: var(--ink-2); font-size: .94rem; text-align: left;
}
.demo-dfy img { flex: none; width: 96px; height: auto; }
.demo-dfy span { min-width: 0; }
.demo-dfy a { font-weight: 700; color: var(--sg-blue); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.demo-dfy a:hover { color: var(--sg-blue-2); }

/* ---------- The transcript: read by screen readers; shown on the page when someone asks for it ---------- */
.demo-transcript { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: 100%; margin-top: 28px; }
.demo-transcript .text-btn { align-self: center; color: var(--ink); font-size: .95rem; }
.transcript:not(.sr-only) {
  width: 100%; max-width: 68ch; margin-top: 18px; padding: clamp(20px, 3vw, 32px);
  background: var(--paper-2); border: var(--edge); border-radius: var(--r-md); box-shadow: var(--raise-sm);
  text-align: left;
}
.transcript h2 { margin: 0 0 14px; font-size: 1.25rem; font-stretch: 108%; }
.transcript p { color: var(--ink-2); }
.transcript p + p { margin-top: .9em; }

/* ---------- The light (demo.js): the video's colours, and the nudges toward the form ----------
   All of it is added by JavaScript and hidden from assistive tech; subtle by design. On paper the colours multiply
   in, so the video's white falls away and its greens and navy tint the page around the frame. */
.demo-ambient {
  position: absolute; left: -12%; top: -20%; z-index: -1; width: 124%; height: 140%;
  border-radius: 50%; filter: blur(30px) saturate(1.7); opacity: .75; mix-blend-mode: multiply;
  pointer-events: none; transition: opacity 1.8s ease;
}
.demo--ambient .demo-frame::before { opacity: 0; animation: none; }
/* At the end the video's light dims as the light behind the form comes up. */
.demo--end .demo-ambient { opacity: .3; }

/* A soft green light that drifts from behind the video down to the form, and the light that stays there at the end. */
.demo-beam, .demo-halo { position: absolute; left: 50%; top: 0; z-index: -1; pointer-events: none; opacity: 0; }
.demo-beam {
  width: min(560px, 94%); height: 190px;
  background: radial-gradient(closest-side, rgba(0, 221, 81, .4), rgba(0, 221, 81, .14) 55%, transparent);
  transform: translate(-50%, calc(var(--beam-from, 0px) - 50%));
}
.demo--nudge .demo-beam { animation: demo-beam 3s cubic-bezier(.45, 0, .25, 1) 1 both; }
.demo-halo {
  width: min(680px, 100%); height: 250px;
  background: radial-gradient(closest-side, rgba(0, 221, 81, .32), rgba(0, 221, 81, .1) 60%, transparent);
  transform: translate(-50%, calc(var(--beam-to, 0px) - 50%));
  transition: opacity 1.8s ease .8s;
}
.demo--end .demo-halo { opacity: 1; }

/* The form's button glows: once per nudge as the light arrives, and slowly at the end until someone presses or
   types. Opacity only, on a ring around the button, so its raised edge and label never move. */
.demo-cta .signup button { position: relative; isolation: isolate; }
.demo-cta .signup button::after {
  content: ""; position: absolute; inset: -1.5px; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 4px rgba(0, 221, 81, .55), 0 0 34px 8px rgba(0, 221, 81, .5);
}
.demo--nudge .demo-cta .signup button::after { animation: demo-nudge 2.6s ease-in-out 1.5s 1 both; }
.demo--breathe .demo-cta .signup button::after { animation: demo-breathe 4.8s ease-in-out infinite; }
.demo-cta .signup.sent button::after { animation: none; opacity: 0; }

/* At the end on a phone with the form below the screen: a glow along the bottom edge leads the eye down until the
   form scrolls into view. */
.demo-edge {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; height: 110px;
  background: radial-gradient(60% 100% at 50% 100%, rgba(0, 221, 81, .32), transparent 72%);
  opacity: 0; pointer-events: none; transition: opacity 1.2s ease;
}
.demo-edge.on { opacity: 1; }

/* Hover only where there's a real pointer, so a tap never leaves it stuck. Like the site's buttons, the face turns green. */
@media (hover: hover) and (pointer: fine) {
  .demo-play:hover::before { opacity: .82; }
  .demo-play:hover .demo-disc::after { background: var(--green); }
}

/* ---------- Wider screens: the video is the hero ---------- */
@media (min-width: 640px) {
  .demo-ambient { filter: blur(46px) saturate(1.7); }
  .demo-disc { width: 96px; height: 96px; }
  .demo-disc::before { inset: -32px; }
  .demo-disc::after { box-shadow: 0 6px 0 0 var(--base), 0 20px 40px -14px rgba(2, 10, 46, .8); }
  .demo-play:focus-visible .demo-disc::after { box-shadow: 0 6px 0 0 var(--base), 0 0 0 4px #fff, 0 0 0 7px var(--green-ink); }
  .demo-disc svg { width: 42px; height: 42px; margin-left: 5px; }
  .demo-label { padding: 8px 16px; font-size: 1.05rem; }
}
@media (max-width: 639px) {
  .demo-frame { border-radius: 18px; }
  .demo-clip { box-shadow: 0 6px 0 0 var(--base); }
  .demo-dfy { flex-direction: column; text-align: center; gap: 10px; }
}

/* ---------- Motion ---------- */
@keyframes demo-glow { 0% { opacity: .75; transform: scale(.99); } 100% { opacity: 1; transform: scale(1.01); } }
@keyframes demo-play-glow { 0% { opacity: .45; transform: scale(.94); } 100% { opacity: 1; transform: scale(1.04); } }
@keyframes demo-beam {
  0% { opacity: 0; transform: translate(-50%, calc(var(--beam-from, 0px) - 50%)) scale(.9); }
  25% { opacity: 1; }
  70% { opacity: 1; transform: translate(-50%, calc(var(--beam-to, 0px) - 50%)) scale(1); }
  100% { opacity: 0; transform: translate(-50%, calc(var(--beam-to, 0px) - 50%)) scale(1.15); }
}
@keyframes demo-nudge { 0%, 100% { opacity: 0; } 35%, 65% { opacity: 1; } }
@keyframes demo-breathe { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }

/* styles.css already shortens every animation and transition under reduced motion; here the loops stop outright, the
   play button's glow holds still a little below its peak, and nothing travels toward the form. */
@media (prefers-reduced-motion: reduce) {
  .demo-frame::before { animation: none !important; }
  .demo-disc::before { animation: none !important; opacity: .8; }
  .demo-beam, .demo-halo, .demo-edge { display: none; }
  .demo-cta .signup button::after { animation: none !important; opacity: 0; }
  .demo-play:active .demo-disc { transform: none; }
}
/* Forced colours: no light effects at all. The play button keeps its triangle and label in the system's colours, and
   the disc an outline. */
@media (forced-colors: active) {
  .demo-ambient, .demo-beam, .demo-halo, .demo-edge, .demo-frame::before,
  .demo-play::before, .demo-disc::before, .demo-cta .signup button::after { display: none; }
  .demo-disc::after { border: 2px solid ButtonText; }
  .demo-disc svg { fill: ButtonText; }
  .demo-label { border: 1px solid ButtonText; }
}
