/* Rediall marketing site: sky. One atmospheric material for the surfaces that
   hold product UI (the demo video's matte, the scroll-story stage, its
   stacked scenes on mobile and without JS), plus the horizon light behind the
   closing card. After hark.com: product UI floats on a mid-tone sky, and
   the copy sits beside or below the picture, never on it. Built only from the
   hue tokens in hues.css: a blue zenith, a lavender drift, an aqua haze low
   down, soft cloud texture and a fine grain. Background-only; the one motion
   is the horizon rising once (reveal). Loads after hues.css, before motion.css. */

:root {
  --sky-base: #e9edfb;
  --sky-fade: linear-gradient(180deg, #d9e2fb 0%, #e8ecfa 55%, #f3f3fa 100%);
  --sky-zenith: 0.62;
  --sky-drift: 0.34;
  --sky-haze: 0.3;
  --sky-cloud: 0.5;
  --sky-track: rgba(255, 255, 255, 0.7);
  --horizon: 0.5;
}

:root[data-theme="dark"] {
  --sky-base: #0a1430;
  --sky-fade: linear-gradient(180deg, #102256 0%, #0b1736 55%, #08101f 100%);
  --sky-zenith: 0.5;
  --sky-drift: 0.26;
  --sky-haze: 0.22;
  --sky-cloud: 0.1;
  --sky-track: rgba(255, 255, 255, 0.16);
  --horizon: 0.85;
}

/* ---------- the material ---------- */

.video-wrap,
.workflow:not(.is-story) .workflow-scene,
.workflow-stage {
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-panel);
  background-color: var(--sky-base);
  background-image:
    radial-gradient(90% 70% at 18% -10%, rgb(var(--hue-blue) / var(--sky-zenith)), transparent 70%),
    radial-gradient(60% 50% at 92% 18%, rgb(var(--hue-violet) / var(--sky-drift)), transparent 70%),
    radial-gradient(100% 55% at 60% 112%, rgb(var(--hue-aqua) / var(--sky-haze)), transparent 70%),
    var(--sky-fade);
}

.workflow:not(.is-story) .workflow-scene {
  position: relative;
}

/* soft cloud texture, then a fine grain so the light never bands */
.video-wrap::before,
.workflow:not(.is-story) .workflow-scene::before,
.workflow-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='420' preserveAspectRatio='none'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0035 .008' numOctaves='4' seed='11'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.9 0 0 0 -0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)'/%3E%3C/svg%3E");
  background-size: 180px 180px, 100% 100%;
  opacity: 1;
}

.video-wrap::before,
.workflow:not(.is-story) .workflow-scene::before,
.workflow-stage::before {
  mask-image: linear-gradient(180deg, #000, rgb(0 0 0 / var(--sky-cloud)));
}

/* the cloud layer is lighter than the sky in both themes; dark keeps it faint */
:root[data-theme="dark"] .video-wrap::before,
:root[data-theme="dark"] .workflow:not(.is-story) .workflow-scene::before,
:root[data-theme="dark"] .workflow-stage::before {
  opacity: 0.35;
}

/* ---------- demo: the real call floats on the sky like the product UI ---------- */

.video-wrap {
  padding: clamp(10px, 3.4vw, 48px);
  box-shadow: none;
}

.video-wrap video {
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-frag);
}

/* ---------- scroll story: bigger UI on the stage, captions off the card ---------- */

.workflow-stage .workflow-scene > div {
  width: min(440px, 100%);
  padding: 24px;
}

.workflow-progress span {
  background: var(--sky-track);
}

.workflow:not(.is-story) .workflow-panels {
  gap: clamp(40px, 5vw, 56px) clamp(16px, 2vw, 24px);
}

/* scenes fill the row so side-by-side captions start on one line */
.workflow:not(.is-story) .workflow-panel {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 20px;
  overflow: visible;
  border-radius: 0;
  background: none;
}

.workflow:not(.is-story) .workflow-caption {
  padding: 0;
}

/* ---------- horizon: a band of light rising behind the closing card ---------- */

.cta-horizon {
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 50%;
  width: max(1100px, 118%);
  margin-left: calc(max(1100px, 118%) / -2); /* not translate: reduced motion resets it on .reveal */
  aspect-ratio: 2 / 1;
  filter: blur(36px);
  pointer-events: none;
}

.cta-horizon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    rgb(var(--hue-blue) / calc(var(--horizon) * 0.8)) 8%,
    rgb(var(--hue-aqua) / var(--horizon)) 50%,
    rgb(var(--hue-blue) / calc(var(--horizon) * 0.8)) 92%
  );
  mask-image: linear-gradient(180deg, #000, transparent 34%);
}

/* it rises once, slower than a section, as the page arrives at its close */
.js .cta-horizon.reveal {
  transition:
    opacity 1200ms var(--ease-ix),
    transform 1600ms var(--ease-out);
}

.js .cta-horizon.reveal:not(.in) {
  transform: translateY(56px);
}

@media (max-width: 760px) {
  .cta-horizon {
    top: 58%;
  }
}

/* high-contrast modes: drop decorative light entirely */
@media (forced-colors: active) {
  .video-wrap,
  .workflow:not(.is-story) .workflow-scene,
  .workflow-stage {
    background-image: none;
  }

  .video-wrap::before,
  .workflow:not(.is-story) .workflow-scene::before,
  .workflow-stage::before,
  .cta-horizon {
    display: none;
  }
}
