/* The tangle beat's ending (Oct 29). Allen: the three outcomes say what "the team's agents work
   better" means, so they are stamps on that headline with fewer words and no line running into
   them; the tangle is there to be felt, not read, so phones get it as a heap. Mobile first. */

/* Phones: a heap, hand-placed (--sx, --sy, --sz per card in story-tangle.njk) with the desktop
   tilts, running off both sides so a few names and words show through. */
@media (max-width: 767px) {
  .rv .st-web > svg.labels { display: none; }
  .rv .st-tangle { overflow-x: clip; }
  .rv .st-bleed .st-web { height: 680px; }
  .rv .st-bleed .st-wc { left: calc(50% + var(--sx)); top: var(--sy); z-index: var(--sz); width: min(230px, 62vw); transform: translateX(-50%) rotate(var(--r)); }
  /* Powerplant sits right under the heap so the threads gather into it. */
  .rv .st-bleed .st-web .st-pp-logo { top: 580px; }
}

/* The Team goal sits about a fifth of its own height above the cards (Allen, Oct 30): the web
   drops by --gg and the goal rises by the same, so the heading above it doesn't move. */
.rv .st-bleed { --gg: 30px; }
.rv .st-bleed .st-web { margin-top: var(--gg); }
.rv .st-bleed .st-web-goal { top: calc(-1 * var(--gg)); }
@media (min-width: 768px) { .rv .st-bleed { --gg: 18px; } }
@media (min-width: 1024px) { .rv .st-bleed { --gg: 34px; } }

/* Phones: the heap runs off both sides of the screen. From 768px the web is exactly as wide as the
   header (24px in from each side, at most --page-max) and its cards stay inside those edges instead
   of hanging half off, so it never jumps wider than the header at any width (Allen, Oct 30). */
.rv .st-bleed { --bleed: 100vw; width: var(--bleed); margin-inline: calc(50% - var(--bleed) / 2); }
@media (min-width: 768px) {
  .rv .st-bleed { --bleed: min(100vw - 48px, var(--page-max)); }
  /* Cards narrow with the screen so the squeezed web still reads, and their centres stay half a
     card plus a tilt's room in from each edge. */
  .rv .st-bleed .st-wc { --cw: clamp(176px, 16vw, 230px); width: var(--cw); left: calc(var(--cw) / 2 + 10px + (100% - var(--cw) - 20px) * var(--x) / 100); }
}
/* Tablets: too narrow for every card to read, so drop the two that phones drop too. */
@media (min-width: 768px) and (max-width: 899px) { .rv .st-bleed .st-wc-desk { display: none; } }


/* Desktop: the same web squashed shorter (Jaycee, Oct 29), its cards in four loose, staggered rows
   so none crowd and no hole opens (Allen, Oct 30). Below 1100px cards are narrower and wrap taller,
   so the rows spread further apart. */
@media (min-width: 768px) {
  .rv .st-bleed .st-web { height: 900px; }
  .rv .st-bleed .st-wc { top: calc(90px + var(--y) * 0.75); }
  .rv .st-bleed .st-web .st-pp-logo { top: 810px; }
}
@media (min-width: 1100px) {
  .rv .st-bleed .st-web { height: 790px; }
  .rv .st-bleed .st-wc { top: calc(90px + var(--y) * 0.6); }
  .rv .st-bleed .st-web .st-pp-logo { top: 700px; }
}

/* The Powerplant logo, caption, outcomes and Book a demo grow and shrink with scroll on the same
   curve as every other beat (story.css); the heap cards stay still (scaling them looked odd).
   Centre with translate rather than inside transform: scale multiplies a transform's translateX, so
   the caption slid sideways as it grew. */
.rv .st-bleed .st-web .st-pp-logo { translate: -50% 0; transform: none; }
/* The caption heads the shared solution, right above it, with the beats' usual room above it. */
.rv-cap { position: relative; z-index: 2; margin: clamp(96px, 11vw, 160px) 0 0; padding: 4px 14px; border-radius: 8px; background: var(--theme-surface); font-size: 20px; line-height: 1.35; text-wrap: balance; color: var(--wf-ink); }
.st-d .rv .st-skill { margin-top: 14px; }
@media (min-width: 768px) { .rv-cap { font-size: 26px; line-height: 1.3; } }
/* Book a demo after the outcomes is half again the usual size and sits midway between the outcomes
   box and the bento heading: the bottom margin takes back what the top adds (Allen, Oct 30). */
.st-d .rv .st-good-cta { --mt: clamp(46px, 6.4vw + 8px, 100px); margin-top: var(--mt); margin-bottom: 0; padding: 18px 32px; border-radius: 14px; font-size: 18px; box-shadow: 0 7px 0 var(--cta-shadow); }
/* Nov 18 (Jaycee: "the buttons are super ginormous on mobile", then "also massive on the desktop page"): the old
   24px size was for one button. The pair matches the closing band's buttons on desktop, a step smaller on phones. */
@media (min-width: 720px) { .st-d .rv .st-good-cta { padding: 22px 40px; font-size: 19px; } }
.st-d .rv .st-good-cta:active { transform: translateY(7px); box-shadow: 0 0 0 var(--cta-shadow); }
@media (prefers-reduced-motion: reduce) { .st-d .rv .rv-cap[data-focus], .st-d .rv .st-good-cta[data-focus], .st-d .rv .st-pp-logo[data-focus] { scale: none; } }

/* The outcomes (Allen, Oct 29: "a stamp associated with the heading", "each stamp has a word and an
   up or down arrow"): the headline in a box with three stamps pressed over its edges and corners.
   One green ink, patchy like a real rubber stamp. Caps are Jaycee's call for stamps. They thunk down
   in turn as the headline scrolls in, quickly (3x faster, Allen, Oct 30), and scale with it. */
.rv-hs-st { --ink: var(--theme-good); }
[data-theme="dark"] .rv-hs-st { --ink: color-mix(in srgb, var(--palette-holly-400) 75%, var(--palette-greyscale-50)); }
.st-good.rv-hs { position: relative; display: block; margin-inline: 4px; padding: 34px 18px; border: 1px solid var(--wf-line); border-radius: 14px; background: var(--wf-card); box-shadow: 0 10px 26px var(--theme-shadow); text-align: center; }
.rv-hs-st { --t: -8deg; position: absolute; padding: 5px 13px 6px; border: 2.5px solid var(--ink); border-radius: 6px; box-shadow: inset 0 0 0 2px var(--wf-card), inset 0 0 0 3.5px var(--ink); background: var(--wf-card); font: 800 12px/1.1 var(--font-heading); letter-spacing: 0.06em; white-space: nowrap; color: var(--ink); transform: rotate(var(--t)); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='70'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.95'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 140px 70px; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='70'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.95'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 140px 70px; }
.rv-hs-st:nth-of-type(2) { --t: -8deg; top: -16px; left: -4px; }
.rv-hs-st:nth-of-type(3) { --t: 3deg; bottom: -16px; left: 50%; translate: -50% 0; }
.rv-hs-st:nth-of-type(4) { --t: 7deg; top: -14px; right: -4px; }
/* The arrow is a size up from the word, with room either side so it never touches the inner ring. */
.rv-ar { display: inline-block; margin-left: 3px; font-size: 1.35em; line-height: 0.8; vertical-align: -0.06em; }
.st-js .rv-hs .rv-hs-st { opacity: 0; }
.st-js .rv-hs.in .rv-hs-st { animation: rv-slam 0.13s cubic-bezier(0.16, 1, 0.3, 1) both; }
.st-js .rv-hs.in .rv-hs-st:nth-of-type(2) { animation-delay: 0.17s; }
.st-js .rv-hs.in .rv-hs-st:nth-of-type(3) { animation-delay: 0.27s; }
.st-js .rv-hs.in .rv-hs-st:nth-of-type(4) { animation-delay: 0.37s; }
@keyframes rv-slam { from { opacity: 0; transform: rotate(calc(var(--t) * 3)) scale(2); } 60% { opacity: 1; } to { opacity: 1; transform: rotate(var(--t)); } }
@media (prefers-reduced-motion: reduce) { .st-js .rv-hs .rv-hs-st { opacity: 1; animation: none; } }
@media (min-width: 768px) {
  .st-good.rv-hs { padding: 48px 72px; }
  .rv-hs-st { padding: 7px 18px 8px; font-size: 16px; }
  .rv-hs-st:nth-of-type(2) { top: -20px; left: -24px; }
  .rv-hs-st:nth-of-type(3) { bottom: -20px; }
  .rv-hs-st:nth-of-type(4) { top: -18px; right: -24px; }
}
