/* Home, "Why Dreamteam?" stop (16 Nov). Served from Cloudflare (~/Desktop/dreamteam-webflow-assets/public/home/why/,
   npx wrangler deploy). The section itself is built in Webflow: its copy is plain text, its cards are the "Why Dreamteam
   cards" CMS collection (title + visual). Webflow's own classes give it its plain layout (phones, tablets, reduced motion,
   no script); this file only adds the pinned, scroll-driven stop, which why.js turns on with .is-staged on desktop.

   Classes, as built in Webflow:
     section.section_home-why > .home-why_component > .home-why_stage
       .home-why_copy > h2.home-why_heading, p.home-why_paragraph (x3; a span.home-why_emphasis is optional)
       .home-why_cards (collection list wrapper) > .home-why_lanes (list) > .home-why_slot (item)
         > .home-why_card > img.home-why_card-visual + .home-why_card-title */

/* runtime pieces why.js adds: each word its own span (screen readers get the sentence once), and the type size the
   stop reads */
.home-why_component { --why-font: clamp(1.25rem, .75rem + 1.4vw, 2rem); }
.home-why_sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; user-select: none; }
.home-why_word { display: inline-block; }

/* cards at their drawn size; on the stop they are scaled by --k (lane size x screen fit) and keep their footprint */
.is-staged .home-why_card { scale: var(--k, 1); margin: calc((var(--k, 1) - 1) * 84px) calc((var(--k, 1) - 1) * 120px); }

/* ---- the pinned stop, v2 (16 Nov): everything on the stop is tied to the scroll, run by the browser's scroll timeline
   (compositor, no per-frame script). why.js moves the page with one inertial engine and glides it between the stops, so
   the scrubbed scene always plays at a smooth, eased pace and nothing can be skipped.
   Stretch of the stop (as a share of the pinned scroll, the "contain" range of --home-why):
     0  – 6%   "Meet Dreamteam" (its copy, the mark, the threads) blurs out and sinks back, completely, on its own
     6  – 14%  then, on a clear dark screen, "Why Dreamteam?" blurs in as one block, nothing else with it
                (both steps are one glide, ~1.3s; Rehan, 16 Nov: "blur out, then the second block blurs in without image")
     16%       then the Shopify part: the cards fade in one after another and drift up their lanes on their own,
     20 – 84%  while the paragraphs come in line by line
     84 – 100% a beat with everything in place before the page moves on
   then, while the section leaves, the copy lifts away and dims. ---- */
.main-wrapper.has-why-stage { timeline-scope: --home-why; }
.section_home-why.is-staged, .section_home-why.is-staged.is-why { background-color: transparent; view-timeline: --home-why block; view-timeline-inset: 0px; }
.section_home-why.is-staged::before { content: ""; position: absolute; inset: 0; background-color: var(--background-color--background-inverse, #121212); opacity: 0; pointer-events: none;
  animation: home-why-dark linear both; animation-timeline: --home-why; animation-range: contain 92% contain 100%;   /* 16 Nov: after the move, so it never covers "Meet Dreamteam" on its way up */ }
@keyframes home-why-dark { to { opacity: 1; } }
.is-staged .home-why_component { height: 140vh;   /* 16 Nov: was 280vh, then 170vh. The pinned stretch is now only the move in; the reading plays on its own once there, and the next scroll leaves (Sree: "I have to scroll a bit to get back to normal scroll") */ padding: 0; font-size: min(var(--why-font), 3.4vh); }
.is-staged .home-why_stage { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; justify-content: center; padding: 5.5rem 1.5rem 2.5rem; overflow: clip; }
.is-staged .home-why_copy { margin: 0; transform-origin: 50% 0;
  animation: home-why-leave linear both; animation-timeline: --home-why; animation-range: exit 0% exit 60%; }
/* 16 Nov: the copy no longer fades and shrinks on the spot as the section goes (it left an empty dark screen before the
   teammates); it simply scrolls away with the page */
@keyframes home-why-leave { 0%, 100% { opacity: 1; transform: none; } }

/* words: each one runs over its own slice of the stretch, --a to --b (why.js) */
.is-staged .home-why_word { opacity: 0; animation-timing-function: linear; animation-fill-mode: both; animation-timeline: --home-why; animation-range: contain var(--a, 0%) contain var(--b, 10%); }
.is-staged .home-why_heading .home-why_word { animation-name: home-why-in; }
/* 16 Nov (Sree, "not this state"): the heading no longer stands alone in the middle of the screen first; it comes in
   in its own place at the head of the copy, on the end of the line from "Meet Dreamteam" (the rail, why.js). The old
   move (home-why-settle, --hx/--hy/--hs) is kept below but no longer used. */
.is-staged .home-why_heading { transform-origin: 0 50%; }
@keyframes home-why-settle {
  0%   { transform: translate3d(var(--hx, 0px), var(--hy, 0px), 0) scale(var(--hs, 1)); animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
  100% { transform: none; } }
.is-staged .home-why_paragraph .home-why_word { animation-name: home-why-word; }
/* the heading is the switch itself, so it blurs in and rises (the eases live in the keyframes: the timeline is linear) */
@keyframes home-why-in {
  0%   { opacity: 0; filter: blur(14px); transform: translate3d(0, .2em, 0); color: #FFC3B9; animation-timing-function: cubic-bezier(.3, .6, .3, 1); }
  60%  { opacity: 1; filter: blur(0px); transform: translate3d(0, .02em, 0); color: #FFE4DF; animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
  100% { opacity: 1; filter: blur(0px); transform: none; color: #fff; } }
/* a light coral tint as each word arrives, white by the time it is fully in; a small lift, no blur (Rehan, 15 Nov) */
@keyframes home-why-word {
  0%   { opacity: 0; transform: translate3d(0, .22em, 0); color: #FFB8AD; animation-timing-function: cubic-bezier(.25, .75, .35, 1); }
  30%  { opacity: .6; color: #FFC9C0; }
  60%  { opacity: 1; transform: none; color: #FFE6E1; }
  100% { opacity: 1; transform: none; color: #fff; } }

/* cards, as on Shopify's careers manifesto (Rehan, 16 Nov: "auto move, not on scroll; only the way they appear is on
   the scroll"): they drift up their side lanes on a clock of their own (55s a lap, each starting at its own point of
   the lap so they are spread over the screen), and the scroll only says when they are on: once the reading starts
   (why.js sets .is-cards) they fade in one after another, 80ms apart, and drift; scrolled back above the reading, or
   on past the section, they fade out and stop. */
.is-staged .home-why_cards { display: block; position: absolute; inset: 0; margin: 0; overflow: hidden; pointer-events: none; container-type: size; --fit: 1;
  --why-space: calc((100cqi - min(min(var(--why-font), 3.4vh) * 21, 100cqi - 3rem)) / 2); --why-lane: calc(var(--why-space) - 48px - 1.5rem);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 7rem, #000 calc(100% - 5rem), transparent); mask-image: linear-gradient(to bottom, transparent, #000 7rem, #000 calc(100% - 5rem), transparent); }
.is-staged .home-why_lanes { position: static; }
.is-staged .home-why_slot { position: absolute; top: 100%; --w: calc(240px * var(--size) * var(--fit)); left: max(.75rem, calc(1.5rem + (var(--why-lane) - var(--w)) * var(--offset)));
  animation: home-why-float 55s linear calc(var(--phase) * -55s) infinite; animation-play-state: paused; }
/* (each lane's five cards start a fifth of a lap apart, so a lane never bunches up) */
.is-staged .home-why_slot:nth-child(even) { left: auto; right: max(.75rem, calc(1.5rem + (var(--why-lane) - var(--w)) * var(--offset))); }
.section_home-why.is-staged.is-cards.is-playing .home-why_slot { animation-play-state: running; }
@keyframes home-why-float { from { translate: 0 0; } to { translate: 0 calc(-1 * (100cqh + 16rem)); } }
/* 16 Nov: they come on scattered (each its own delay) but all go at once, quickly, so none lingers over "Meet Dreamteam"
   on the way back up */
.is-staged .home-why_slot .home-why_card { opacity: 0; transition: opacity .2s ease 0ms; }
.is-staged.is-cards .home-why_slot .home-why_card { opacity: var(--o, .55); transition: opacity .9s cubic-bezier(.16, 1, .3, 1) var(--d, 0ms); }   /* held back (why.js sets --o) */
.is-staged .home-why_slot:nth-child(1)  { --size: 1;   --offset: .1;  --phase: 0;   }
.is-staged .home-why_slot:nth-child(2)  { --size: .92; --offset: .2;  --phase: .1; }
.is-staged .home-why_slot:nth-child(3)  { --size: .84; --offset: .9;  --phase: .4;  }
.is-staged .home-why_slot:nth-child(4)  { --size: 1;   --offset: .85; --phase: .5; }
.is-staged .home-why_slot:nth-child(5)  { --size: .9;  --offset: .3;  --phase: .8;  }
.is-staged .home-why_slot:nth-child(6)  { --size: .86; --offset: .6;  --phase: .9; }
.is-staged .home-why_slot:nth-child(7)  { --size: 1;   --offset: .7;  --phase: .2;  }
.is-staged .home-why_slot:nth-child(8)  { --size: .9;  --offset: .15; --phase: .3; }
.is-staged .home-why_slot:nth-child(9)  { --size: .88; --offset: .2;  --phase: .6;  }
.is-staged .home-why_slot:nth-child(10) { --size: 1;   --offset: .9;  --phase: .7; }
/* perf: no backdrop blur on cards over a flat dark (it re-rendered every moving card each frame for nothing) */
.is-staged .home-why_slot .home-why_card { --k: calc(var(--size) * var(--fit)); -webkit-backdrop-filter: none; backdrop-filter: none; background: #e9e9e9; }
@media (max-width: 1439px) { .is-staged .home-why_cards { --fit: .85; } }
@media (max-width: 1179px) { .is-staged .home-why_cards { --fit: .7; } }
@media (max-width: 1099px) { .is-staged .home-why_cards { --fit: .58; } }

/* the dark stop under it ("Meet Dreamteam", the mark, its threads) sinks back and blurs out over the first part of the
   switch, on the same timeline (shared up to the page wrapper); before the stop it is left to its own scene */
/* only what is on the dark goes; the dark itself (the component's background) stays put, full screen, so nothing
   lighter behind it can show at the edges (16 Nov: a light band showed at the bottom while the whole block shrank) */
/* 16 Nov (Sree, 3rd pass: "the experience with the line still feels terrible"). Meet Dreamteam -> Why Dreamteam? is now
   a plain camera move: the two stops sit one screen apart on one tall page, and the glide scrolls that page by exactly
   one screen. Nothing fades, blurs or changes speed; "Meet Dreamteam" with its mark goes up and off the top while
   "Why Dreamteam?" comes up from below, and the mark's line (why.js) is part of that page, running from the foot of
   the mark down to just above the title, where it fades out. (Was: a 55vh lift with fades, which read as a dissolve.) */
.has-why-stage .section_home-memory .home-memory_intro > *, .has-why-stage .section_home-memory .home-memory_visual, .has-why-stage .section_home-memory .home-memory_component > .padding-global {
  animation: home-why-lift linear forwards; animation-timeline: --home-why; animation-range: contain 0% contain 100%; }
@keyframes home-why-lift { 0% { translate: 0 0; } 100% { translate: 0 -100vh; } }
.has-why-stage.is-why .home-memory_teaser { visibility: hidden; }
.is-staged .home-why_copy { translate: 0 0; }
.is-staged.is-why .home-why_copy, .is-staged .home-why_copy { animation: home-why-leave linear both, home-why-rise linear both; animation-timeline: --home-why, --home-why;
  animation-range: exit 0% exit 60%, contain 0% contain 100%; }
@keyframes home-why-rise { 0% { translate: 0 100vh; } 100% { translate: 0 0; } }
/* the title and the first line are simply there, as print on that page (why.js takes them out of the word-by-word
   reading); the second line waits part way in, in grey, at the stop */
.is-staged .home-why_word.is-set { animation: none; opacity: 1; transform: none; color: #fff; }
@keyframes home-why-recede {
  0%   { opacity: 1; filter: blur(0px); transform: none; animation-timing-function: cubic-bezier(.4, 0, .6, 1); }
  100% { opacity: 0; filter: blur(16px); transform: scale(.97); } }   /* no longer used */

/* The section under the teammates ("One CRM. Two ways in.") wears the same film as the teammates' wash at its foot
   (#222) and lets it go on the same curve, so where the two meet they match at every moment of the light change (the
   wash alone left a darker band above the line mid-fade). ways.js sets .is-lit and --wash-t. */
.home-ways_component { position: relative; isolation: isolate; }
/* 16 Nov: the film's strength is --dim, scrubbed by ways.js with the scroll (1 dark, 0 clear); no script, no film */
.home-ways_component::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #222; pointer-events: none; opacity: var(--dim, 0); }

/* "One CRM. Two ways in." illustrations at the sizes of the reference build (artifact "Dreamteam Homepage Three",
   16 Nov, Rehan: the windows and what's on them had got too small at 70%). There the card's picture is 512 x 372;
   the app drawing (Figma 439:7258) sits at full size, its 630 x 479 frame offset 46px left and 60px up so the window
   and the first two teammates show; the headless drawing (439:7309) is its frame scaled to the card's width, from the
   top-left. The mockups here are already drawn to the card's width, so the app one is scaled up by 630/512 and both
   are pinned top-left. Offsets are in % of the width, so the layout holds as the card narrows. */
.home-ways_visual { aspect-ratio: 512 / 372 !important; }
.home-ways_mock { top: 0 !important; margin-top: 0 !important; overflow: visible !important; transform-origin: 0 0 !important; }
.home-ways_mock.is-app { left: -8.9844% !important; margin-top: -11.7188% !important; scale: 1.2305; }

/* 16 Nov (Sree): the reading plays on its own, line after line, once the page lands on the stop (why.js sets
   .is-reading), instead of being scrubbed by the scroll. Each line starts --t after the one before; the first line is
   already there. Scrolled back up, it resets and plays again next time. */
.section_home-why.is-staged .home-why_paragraph .home-why_word:not(.is-set) { animation: none; opacity: 0; }
.section_home-why.is-staged.is-reading .home-why_paragraph .home-why_word:not(.is-set) {
  animation: home-why-word 650ms linear var(--t, 0ms) both; animation-timeline: auto; animation-range: normal; }
@media (prefers-reduced-motion: reduce) {
  .section_home-why.is-staged .home-why_paragraph .home-why_word:not(.is-set) { animation: none !important; opacity: 1; color: #fff; transform: none; } }
/* 16 Nov: with the shorter stop, the "Meet Dreamteam" scene behind it showed its later state (its own "Why Dreamteam?"
   team copy, agents and paths) through the gap above the teammates. Once the page is past "Meet Dreamteam", those stay
   hidden; the dark behind them stays */
.has-why-stage.is-why .section_home-memory .home-memory_team,
.has-why-stage.is-why .section_home-memory .home-memory_agents,
.has-why-stage.is-why .section_home-memory .home-memory_paths { visibility: hidden !important; }
/* 16 Nov: no lone last word; the browser also evens out the last lines where it can */
.home-why_paragraph, .home-why_heading { text-wrap: pretty; }
.home-why_keep { display: inline-block; white-space: nowrap; }
.has-why-stage.is-why-past .section_home-memory .home-memory_component { visibility: hidden; }

/* 16 Nov (Sree): the copy is centred under the title, the paragraphs at 0.8em */
.is-staged .home-why_paragraph { font-size: .8em; text-align: center; margin-left: auto; margin-right: auto; }

/* 15 Nov (Bharath): "Why Dreamteam?" in Telegraf, like the "Meet Dreamteam" heading */
.home-why_heading { font-family: PPtelegraf, Arial, sans-serif; }

/* 15 Nov (Sree's Figma, file T8Y5CaDLfa092UwvQDt52Y node 1452-6680): the cards sit at different depths and angles. Back
   cards are smaller, fainter and slightly soft; front cards are larger and fully opaque; each is tilted a few degrees.
   The drift, lanes and timing are unchanged. */
.is-staged .home-why_slot { z-index: var(--z, 1); }
.is-staged .home-why_slot .home-why_card { rotate: var(--tilt, 0deg); filter: var(--soft, none); }
.is-staged.is-cards .home-why_slot .home-why_card { opacity: var(--depth-o, .9); }
.is-staged .home-why_slot:nth-child(1)  { --size: 1.05; --depth-o: 1;   --tilt: -4deg; --z: 3; --soft: none; }
.is-staged .home-why_slot:nth-child(2)  { --size: .7;   --depth-o: .55; --tilt: 5deg;  --z: 1; --soft: blur(1.5px); }
.is-staged .home-why_slot:nth-child(3)  { --size: .7;   --depth-o: .5;  --tilt: 6deg;  --z: 1; --soft: blur(1.5px); }
.is-staged .home-why_slot:nth-child(4)  { --size: 1;    --depth-o: .95; --tilt: -3deg; --z: 3; --soft: none; }
.is-staged .home-why_slot:nth-child(5)  { --size: .86;  --depth-o: .8;  --tilt: 3deg;  --z: 2; --soft: none; }
.is-staged .home-why_slot:nth-child(6)  { --size: .86;  --depth-o: .8;  --tilt: -5deg; --z: 2; --soft: none; }
.is-staged .home-why_slot:nth-child(7)  { --size: .68;  --depth-o: .5;  --tilt: -6deg; --z: 1; --soft: blur(1.5px); }
.is-staged .home-why_slot:nth-child(8)  { --size: 1.05; --depth-o: 1;   --tilt: 4deg;  --z: 3; --soft: none; }
.is-staged .home-why_slot:nth-child(9)  { --size: 1;    --depth-o: .95; --tilt: 3deg;  --z: 3; --soft: none; }
.is-staged .home-why_slot:nth-child(10) { --size: .7;   --depth-o: .55; --tilt: -4deg; --z: 1; --soft: blur(1.5px); }

/* the beacon where the line from "Meet Dreamteam" meets the title (Sree's Figma): a small red light with a soft glow */
.is-staged .home-why_heading { position: relative; }
.is-staged .home-why_heading::before { content: ""; position: absolute; left: 50%; top: -18px; width: 7px; height: 7px; border-radius: 50%;
  translate: -50% -50%; background: #F92810; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(249, 40, 16, .18), 0 0 18px 6px rgba(249, 40, 16, .35); }
