/* Morph tuning for the hub (D6), linked after the vendored motion system (public/motion/ps-*.css).
   Same rules as the system: every moving or hiding style sits behind BOTH prefers-reduced-motion: no-preference
   AND html.ps-boot:not(.ps-reduce):not(.ps-nojs); movement uses transform/translate/scale only; text is never
   faded. */

:root {
  --ps-scroll-pad: 96px;
}
/* Stagger and hero offsets from position, not style attributes (plan C12). */
:is([data-ps~='stagger'], [data-ps~='hero']) > :nth-child(2) {
  --i: 1;
}
:is([data-ps~='stagger'], [data-ps~='hero']) > :nth-child(3) {
  --i: 2;
}
:is([data-ps~='stagger'], [data-ps~='hero']) > :nth-child(4) {
  --i: 3;
}
:is([data-ps~='stagger'], [data-ps~='hero']) > :nth-child(5) {
  --i: 4;
}
:is([data-ps~='stagger'], [data-ps~='hero']) > :nth-child(6) {
  --i: 5;
}
:is([data-ps~='stagger'], [data-ps~='hero']) > :nth-child(7) {
  --i: 6;
}
:is([data-ps~='stagger'], [data-ps~='hero']) > :nth-child(n + 8) {
  --i: 7;
}

/* Photo frames added around images (the effect's clipping box). */
.psm-frame {
  display: block;
  position: relative;
  overflow: clip;
}
.nt-fig .psm-frame {
  border-radius: 6px;
}
.nt-fig.phone .psm-frame {
  border-radius: 24px;
}
.proof .psm-frame {
  width: 150px;
  border-radius: 18px;
}

/* ---- Page transitions --------------------------------------------------------------------------------------
   ps-vt.css hides the old page outright and shows the new one at once; Morph only MOVES the new page, never
   part-transparent. Named elements that hold text (header, package cards) fly to their new place as the NEW
   snapshot only (old hidden at once): moved and resized, never cross-faded. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes psm-rise {
    from {
      translate: 0 16px;
    }
  }
  html.psm.ps-boot:not(.ps-reduce):not(.ps-nojs)::view-transition-new(root) {
    animation: psm-rise 420ms var(--ps-ease-out) both !important;
  }
  html.psm.ps-boot:not(.ps-reduce):not(.ps-nojs)::view-transition-old(psm-header),
  html.psm.ps-boot:not(.ps-reduce):not(.ps-nojs)::view-transition-old(*.psm-pkg) {
    animation: none !important;
    opacity: 0;
  }
  html.psm.ps-boot:not(.ps-reduce):not(.ps-nojs)::view-transition-new(psm-header),
  html.psm.ps-boot:not(.ps-reduce):not(.ps-nojs)::view-transition-new(*.psm-pkg) {
    animation: none !important;
  }
  html.psm.ps-boot:not(.ps-reduce):not(.ps-nojs)::view-transition-group(*.psm-pkg) {
    animation-duration: 620ms;
  }
  html.psm.ps-boot:not(.ps-reduce):not(.ps-nojs)::view-transition-group(psm-header) {
    z-index: 2;
  }
}

/* ---- Evidence stack ------------------------------------------------------------------------------- */
html.psm .nt-more .nt-grid[data-ps~='stack'] {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin-inline: auto;
}
html.psm .nt-more .nt-grid[data-ps~='stack'] > * {
  background: #08063a;
  padding-block: 14px;
  margin: 0;
}
html.psm.ps-boot.ps-js:not(.ps-reduce):not(.ps-nojs) [data-ps~='stack']:not(.ps-tall):not(:focus-within) > * {
  top: 76px;
}
