/* Data+ motion layer — scroll story (stage + panels + tags) and reveals.
   Additive only: the original page stays intact underneath. Everything here
   is scoped to html.dpm (set by motion.js once WebGL + data are ready). */

:root {
  --dpm-violet: #7B5CFA;
  --dpm-violet-d: #6A4BF0;
  --dpm-lilac: #B07BFF;
  --dpm-ink: #0B1220;
  --dpm-sub: #5B6472;
  --dpm-mute: #8A93A3;
  --dpm-line: #EAECF2;
  --dpm-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --dpm-ease: cubic-bezier(.2, .7, .2, 1);
}

/* boot: hide the page until the layer decides (failsafe in the head script) */
html.dpm-boot #dc-root { opacity: 0; }
#dc-root { transition: opacity .5s ease; }

html.dpm { scroll-behavior: auto !important; }
html.dpm, html.dpm body, html.dpm #dc-root, html.dpm #dc-root > div { height: auto !important; min-height: 0; }
html.dpm body { background: #F7F8FB; }
html.dpm.lenis-smooth { scroll-behavior: auto !important; }
html.dpm.lenis-stopped { overflow: hidden; }

/* the story replaces these three blocks (their text is read from them) */
html.dpm [data-hero-section],
html.dpm #about,
html.dpm #how { display: none !important; }

/* header floats above the stage */
html.dpm:not(.dpm-contrib) #dc-root header { position: fixed !important; top: 0; left: 0; right: 0; }
html.dpm #dc-root { position: relative; z-index: 10; }

/* content after the story slides up over the stage as one card */
html.dpm [data-screen-label="Compliance"] {
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -30px 80px rgba(40, 24, 110, .16);
  padding-top: 30px !important;
}
html.dpm [data-screen-label="Ecosystem logos"],
html.dpm #solutions { background: #fff; }

/* ------------------------------------------------------------ story ---- */
#dpm-story { position: relative; z-index: 1; pointer-events: none; font-family: Inter, -apple-system, system-ui, 'Segoe UI', sans-serif; color: #0F172A; }

.dpm-stage {
  position: fixed; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(52% 46% at 72% 38%, rgba(123, 92, 250, .12), transparent 72%),
    radial-gradient(40% 40% at 12% 90%, rgba(176, 123, 255, .10), transparent 70%),
    linear-gradient(180deg, #FFFFFF 0%, #FAFAFC 62%, #F1EFF9 100%);
}
.dpm-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; }
.dpm-stage canvas.on { opacity: 1; }
.dpm-grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: dpmGrain 1.2s steps(4) infinite;
}
@keyframes dpmGrain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); }
}
/* the films of her, drawn exactly over the particle square */
.dpm-media { position: absolute; left: 0; top: 0; will-change: transform; overflow: hidden;
  /* feathered on the left, top and bottom; the right side runs to the screen edge */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%), linear-gradient(180deg, transparent, #000 8%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 12%), linear-gradient(180deg, transparent, #000 8%, #000 90%, transparent);
  mask-composite: intersect; }
.dpm-media .dpm-hero-vid { width: 101%; } /* hides the hero film's dark last column */
.dpm-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.dpm-wash { position: absolute; inset: auto 0 0 0; height: 26vh; background: linear-gradient(180deg, transparent, rgba(247, 248, 251, .9)); pointer-events: none; }

.dpm-panels, .dpm-tags { position: fixed; inset: 0; pointer-events: none; }
.dpm-panels { z-index: 6; }
.dpm-tags { z-index: 5; }

.dpm-panel {
  position: absolute; top: calc(50% + 36px); transform-origin: 0 50%;
  left: max(28px, calc(50vw - 572px));
  opacity: 0; will-change: transform, opacity;
}
.dpm-panel[data-side="right"] { left: auto; right: max(28px, calc(50vw - 572px)); transform-origin: 100% 50%; }
.dpm-panel.live { pointer-events: auto; }

/* hero keeps the exact original copy block (cloned) */
.dpm-hero { width: min(560px, 46vw); }
.dpm-hero [data-hero-copy] { animation: none !important; max-width: 560px; }
.dpm-hero [data-hero-cta-primary]:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 16px 34px rgba(106,75,240,.38) !important; color: #fff !important; }
.dpm-hero [data-hero-cta-secondary]:hover { border-color: #CBD1DC !important; color: #0F172A !important; }
.dpm-hero h1 span[data-cms-id="hero.h1Line2"] { padding-right: .08em; }
.dpm-cue {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 44px;
  font: 500 11.5px/1 var(--dpm-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dpm-mute);
}
.dpm-cue svg { animation: dpmCue 1.8s var(--dpm-ease) infinite; }
@keyframes dpmCue { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(5px); opacity: .5; } }

/* caption card */
.dpm-card {
  width: min(470px, 40vw);
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid rgba(226, 229, 236, .9);
  border-radius: 24px; padding: 30px 32px 26px;
  box-shadow: 0 1px 0 #fff inset, 0 30px 70px rgba(40, 24, 110, .12), 0 2px 8px rgba(16, 24, 40, .04);
}
.dpm-eyebrow { display: block; font: 500 11.5px/1.4 var(--dpm-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dpm-mute); }
.dpm-eyebrow b { color: var(--dpm-violet); font-weight: 600; }
.dpm-h {
  margin: 14px 0 0; font-family: Inter, sans-serif; font-weight: 700;
  font-size: clamp(28px, 3vw, 40px); line-height: 1.08; letter-spacing: -.025em; color: #0F172A;
}
.dpm-h .w { display: inline-block; opacity: 0; transform: translateY(.34em); filter: blur(4px);
  transition: opacity .6s var(--dpm-ease), transform .7s var(--dpm-ease), filter .6s var(--dpm-ease); }
.dpm-h .w.o {
  font-style: italic; padding-right: .04em;
  background: linear-gradient(100deg, #1A1330 0%, #6A4BF0 55%, #B07BFF 110%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dpm-panel.in .dpm-h .w { opacity: 1; transform: none; filter: none; }

/* lines advance one at a time with the scroll (crossfade in one slot) */
.dpm-lines { display: grid; margin-top: 16px; }
.dpm-line {
  grid-area: 1 / 1; margin: 0; font-size: 17px; line-height: 1.6; color: var(--dpm-sub); text-wrap: pretty;
  opacity: 0; transform: translateY(10px); transition: opacity .55s var(--dpm-ease), transform .65s var(--dpm-ease);
}
.dpm-line.on { opacity: 1; transform: none; }
.dpm-foot { margin-top: 20px; opacity: 0; transition: opacity .6s ease .35s; }
.dpm-panel.in .dpm-foot { opacity: 1; }

/* step header */
.dpm-step { display: flex; align-items: center; gap: 14px; }
.dpm-step-ico {
  width: 50px; height: 50px; flex: none; border-radius: 15px; background: #fff; border: 1px solid #E2E5EC;
  display: flex; align-items: center; justify-content: center; color: var(--dpm-violet);
  box-shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 20px rgba(123,92,250,.14);
}
.dpm-step .dpm-h { margin: 0; }

/* stepper: Recruit · Capture · Verify · Structure · Deliver */
.dpm-stepper { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--dpm-line); }
.dpm-stepper::before, .dpm-stepper i {
  content: ""; position: absolute; top: 24px; left: 10%; right: 10%; height: 2px; border-radius: 2px; background: #E6E3F3;
}
.dpm-stepper i { right: auto; width: calc(80% * var(--f, 0)); background: linear-gradient(90deg, var(--dpm-violet), var(--dpm-lilac)); transition: width .8s var(--dpm-ease); }
.dpm-stepper span {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px;
  font: 500 10.5px/1.2 var(--dpm-mono); letter-spacing: .08em; text-transform: uppercase; color: #A3AAB8; transition: color .4s;
}
.dpm-stepper span::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #D9D4EE; box-sizing: border-box;
  transition: background .4s, border-color .4s, box-shadow .4s, transform .4s var(--dpm-ease);
}
.dpm-stepper span.done { color: var(--dpm-sub); }
.dpm-stepper span.done::before { background: var(--dpm-violet); border-color: var(--dpm-violet); }
.dpm-stepper span.on { color: var(--dpm-violet-d); }
.dpm-stepper span.on::before { background: var(--dpm-violet); border-color: var(--dpm-violet); box-shadow: 0 0 0 5px rgba(123,92,250,.18); transform: scale(1.15); }

/* ------------------------------------------------------------- tags ---- */
.dpm-tag { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; }
.dpm-tag-in {
  transform: translateY(12px) scale(.96); transition: transform .6s var(--dpm-ease);
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 229, 236, .95); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(40, 24, 110, .14), 0 1px 3px rgba(16, 24, 40, .06);
}
.dpm-tag.on .dpm-tag-in { transform: none; }
.dpm-mono { font: 500 10.5px/1.35 var(--dpm-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dpm-mute); }

/* HUD (hero) */
.dpm-hud { width: 236px; padding: 16px 18px; }
.dpm-hud hr { width: 36px; height: 2px; margin: 0 0 12px; border: 0; background: var(--dpm-violet); }
.dpm-hud strong { display: block; margin: 5px 0 12px; font: 600 13px/1.3 var(--dpm-mono); letter-spacing: .06em; color: var(--dpm-ink); }
.dpm-hud strong:last-child { margin-bottom: 0; }
.dpm-ok { color: var(--dpm-violet-d) !important; display: inline-flex !important; align-items: center; gap: 7px; }
.dpm-ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dpm-violet); box-shadow: 0 0 0 4px rgba(123,92,250,.18); animation: dpmPulse 1.6s ease-in-out infinite; }
@keyframes dpmPulse { 50% { box-shadow: 0 0 0 7px rgba(123,92,250,0); } }

/* ---------------------------------------------------------- reveals ---- */
html.dpm [data-dpm-mod] { position: relative; }
.dpm-modbar { position: absolute; top: -1px; left: 22px; right: 22px; height: 2px; border-radius: 2px; background: transparent; overflow: hidden; pointer-events: none; }
.dpm-modbar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: linear-gradient(90deg, var(--dpm-violet), var(--dpm-lilac)); }
.dpm-modnum { position: absolute; top: 16px; right: 18px; font: 500 10.5px/1 var(--dpm-mono); letter-spacing: .12em; color: #B9BFCB; transition: color .4s; pointer-events: none; }
html.dpm [data-dpm-mod].dpm-act { border-color: #D9CCF7 !important; box-shadow: 0 24px 60px rgba(123, 92, 250, .14) !important; }
html.dpm [data-dpm-mod].dpm-act .dpm-modnum { color: var(--dpm-violet); }
html.dpm [data-dpm-mod] [data-modality-icon] { transition: transform .6s var(--dpm-ease); }
html.dpm [data-dpm-mod].dpm-act [data-modality-icon] { transform: translateY(-4px) scale(1.04); }

/* ----------------------------------------------------------- mobile ---- */
/* stacked layout: phones + portrait screens (set by motion.js as html.dpm-stack) */
html.dpm-stack .dpm-panel, html.dpm-stack .dpm-panel[data-side="right"] {
  top: auto; bottom: 18px; left: max(16px, calc(50vw - 320px)); right: max(16px, calc(50vw - 320px)); transform-origin: 50% 100%; }
html.dpm-stack .dpm-hero { width: auto; }
html.dpm-stack .dpm-card { width: auto; }
html.dpm-stack .dpm-media { -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(180deg, #000 70%, transparent 99%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(180deg, #000 70%, transparent 99%);
  mask-composite: intersect; }
html.dpm-stack .dpm-cue, html.dpm-stack .dpm-tags { display: none; }

/* phones: compact type so she keeps the top of the screen */
@media (max-width: 760px) {
  .dpm-card { padding: 22px 20px 18px; border-radius: 20px; }
  .dpm-h { font-size: 27px; }
  .dpm-line { font-size: 15px; }
  .dpm-stepper span { font-size: 8.5px; letter-spacing: .04em; }
  .dpm-hero [data-hero-copy] h1 { font-size: 28px !important; margin-top: 12px !important; }
  .dpm-hero [data-hero-copy] h1 span { font-size: inherit !important; line-height: inherit !important; }
  .dpm-hero p[data-cms-id="hero.paragraph"] { font-size: 15px !important; line-height: 1.5 !important; margin-top: 10px !important; }
  .dpm-hero [data-hero-cta-row] { margin-top: 16px !important; gap: 8px !important; flex-wrap: nowrap !important; flex-direction: row !important; }
  .dpm-hero [data-hero-cta-row] a { width: auto !important; min-width: 0 !important; }
  .dpm-hero [data-hero-cta-row] a { padding: 12px 14px !important; font-size: 13.5px !important; white-space: nowrap; flex: 1 1 auto; justify-content: center; }
  .dpm-hero [data-hero-cta-row] a[data-hero-cta-secondary] { font-size: 11.5px !important; flex: 0 1 auto; }
  .dpm-hero [data-cms-id="hero.badge"] { font-size: 9px !important; letter-spacing: .06em !important; padding: 6px 10px !important; }
}

/* contributor globe replaces the flat network (kept underneath, hidden) */
html.dpm [data-network-visual].dpm-globe-on > :not(.dpm-globe):not(:first-child) { visibility: hidden; }
.dpm-globe { position: absolute; inset: -4%; width: 108%; height: 108%; display: block; z-index: 4; }

/* ------------------------------------------ Become a Contributor page ---- */
.dpm-pagebg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(46% 40% at 18% 78%, rgba(123, 92, 250, .10), transparent 70%),
    radial-gradient(40% 36% at 84% 22%, rgba(176, 123, 255, .12), transparent 72%),
    linear-gradient(180deg, #FFFFFF 0%, #FAFAFC 60%, #F3F1FA 100%); }
html.dpm-contrib body { background: transparent; }

/* the globe card replaces the contributors video */
html.dpm .dpm-cbox { background: radial-gradient(70% 70% at 60% 40%, #FBF8FF, #ECE5FF 70%, #E2D8FF) !important; }
html.dpm .dpm-cbox > media-slot { visibility: hidden; }
.dpm-cbox .dpm-globe { inset: -2%; width: 104%; height: 104%; }

/* "You" portal */
.dpm-you { position: absolute; right: 18px; bottom: 18px; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 7px;
  transition: transform .9s cubic-bezier(.5,0,.2,1), opacity .6s ease .35s; }
.dpm-you-ring { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px dashed rgba(123, 92, 250, .55); background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: dpmYou 2.4s ease-in-out infinite; transition: background .3s, border-color .3s, box-shadow .3s; }
.dpm-you-ring b { font: 800 22px/1 Inter, sans-serif; color: var(--dpm-violet); letter-spacing: -.02em; }
.dpm-you.typing .dpm-you-ring { border-style: solid; border-color: var(--dpm-violet); background: #fff; box-shadow: 0 0 0 6px rgba(123,92,250,.14), 0 10px 26px rgba(123,92,250,.3); }
.dpm-you-label { font: 500 10.5px/1 var(--dpm-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dpm-violet-d); }
.dpm-you.fly { transform: translate(calc(-50% - 120px), calc(-50% - 110px)) scale(.4); opacity: 0; }
@keyframes dpmYou { 50% { box-shadow: 0 0 0 8px rgba(123,92,250,.10); } }
.dpm-you-toast { position: absolute; left: 50%; bottom: 18px; z-index: 7; transform: translate(-50%, 16px); opacity: 0; white-space: nowrap;
  padding: 10px 16px; border-radius: 999px; background: #fff; border: 1px solid #E4DEFA; box-shadow: 0 14px 36px rgba(40,24,110,.16);
  font: 600 14px/1 Inter, sans-serif; color: var(--dpm-ink); transition: opacity .5s ease, transform .6s var(--dpm-ease); pointer-events: none; }
.dpm-you-toast::before { content: "✓"; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 8px;
  border-radius: 50%; background: linear-gradient(180deg, #8E72FF, #6A4BF0); color: #fff; font-size: 11px; }
.dpm-you-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* form progress line */
html.dpm-contrib form { position: relative; overflow: hidden; }
.dpm-fbar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #F1EDFF; }
.dpm-fbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--dpm-violet), var(--dpm-lilac)); transition: width .6s var(--dpm-ease); }
.dpm-fbar-t { position: absolute; right: 16px; top: 12px; font: 500 10.5px/1 var(--dpm-mono); letter-spacing: .12em; color: #A3AAB8; transition: color .3s; }
.dpm-fbar.ok .dpm-fbar-t { color: var(--dpm-violet-d); }
@media (max-width: 760px) { .dpm-you-ring { width: 52px; height: 52px; } .dpm-you.fly { transform: translate(-90px, -90px) scale(.4); } }
