/* ==========================================================================
   fx-kit.css | FB funnel motion + glow kit, re-keyed to brand variables
   Source: output/fb-funnel/index.html (live at trombonetimollc.com), packaged 2026-10-06.
   Catalog + usage: FX-KIT.md (same folder).

   Load AFTER the page's own CSS. Pair with fx-kit.js (defer) and the one-line
   head snippet in FX-KIT.md (adds html.fx-js before first paint).

   Contract
   - Everything that moves lives in @media (prefers-reduced-motion: no-preference).
     Outside it the page is static and complete (glows stay, motion goes).
   - Scroll reveals start from a VISIBLE state (offset + slight scale/blur, opacity >= .6),
     and only when html.fx-js is set. No JS = no pre-state = finished page.
   - Reveal / hover use the individual `translate` and `scale` properties, so the kit never
     clobbers a page element's own `transform` (except .fx-lift / .fx-tilt hover, see FX-KIT.md).
   - Defaults are tuned for LIGHT pages. Put .fx-dark on a dark band to get the funnel's
     original (dark) glow numbers; .fx-light switches back inside it.
   ========================================================================== */

/* ---------- 0. Brand inputs (zero specificity: any page :root rule wins) ---------- */
:where(:root) {
  --fx-accent: #dc2626;            /* solid accent: CTA glow, strikes, rules, sparks */
  --fx-accent-rgb: 220, 38, 38;    /* the same color as r, g, b; every glow is built from it */
  /* --fx-glow: r, g, b;              optional: glow color if it must differ from the accent */
  --fx-ink: #15171c;
  --fx-ink-rgb: 21, 23, 28;        /* soft shadow tint on light pages */
  --fx-bg: #ffffff;
  --fx-bg-rgb: 255, 255, 255;      /* page ground: Ken Burns bottom melt */

  /* easings lifted from the funnel */
  --fx-ease-out: cubic-bezier(.2, .8, .2, 1);      /* heroRise, leadPop */
  --fx-ease-pop: cubic-bezier(.2, 1.4, .35, 1);    /* n8Pop overshoot */
  --fx-ease-win: cubic-bezier(.2, 1.5, .35, 1);    /* mkWin overshoot */
  --fx-ease-draw: cubic-bezier(.4, 0, .2, 1);      /* mtDraw, n8Draw */
  --fx-ease-strike: cubic-bezier(.65, 0, .35, 1);  /* mkStrike */
  --fx-ease-lift: cubic-bezier(.2, .7, .3, 1);     /* client-card hover */
  --fx-ease-bob: cubic-bezier(.45, 0, .35, 1);     /* cueBounce, handBob */
  --fx-step: 90ms;                                 /* stagger step between siblings */
}

/* LIGHT tuning (default): lower alpha, tighter blur, accent-colored, never white */
:where(:root), .fx-light {
  --fx-cta-y: 14px; --fx-cta-blur: 30px; --fx-cta-spread: -12px; --fx-cta-a: .42; --fx-cta-hover-a: .55;
  --fx-pulse-w: 10px; --fx-pulse-a: .16; --fx-pulse-scale: 1.03;
  --fx-halo-a: .16; --fx-halo-blur: 28px; --fx-halo-lo: .6;
  --fx-rim-rgb: initial; --fx-rim-a: .16;
  --fx-frame-a: .24;
  --fx-shade-rgb: initial; --fx-shade-a: .26; --fx-shade-blur: 60px; --fx-shade-spread: -24px;
  --fx-lift-a: .16; --fx-lift-shade-a: .22;
  --fx-ring-inset: -12%; --fx-spin-blur: 10px; --fx-spin-lo: .4; --fx-spin-hi: .65;
  --fx-ring-2: rgba(var(--fx-accent-rgb), .28);
  --fx-spark: initial; --fx-spark-2: initial; --fx-spark-3: initial; --fx-spark-glow-rgb: initial;
  --fx-spark-a: .35; --fx-arrow-a: .28;
  --fx-play-ring-rgb: initial; --fx-play-ring-a: .16; --fx-play-ring-hover-a: .22;
}

/* DARK tuning: the funnel's own numbers (it is a near-black page) */
.fx-dark {
  --fx-cta-y: 18px; --fx-cta-blur: 52px; --fx-cta-spread: -8px; --fx-cta-a: .7; --fx-cta-hover-a: .8;
  --fx-pulse-w: 14px; --fx-pulse-a: .18;
  --fx-halo-a: .28; --fx-halo-blur: 40px; --fx-halo-lo: .55;
  --fx-rim-rgb: 255, 255, 255; --fx-rim-a: .06;
  --fx-frame-a: .18;
  --fx-shade-rgb: 0, 0, 0; --fx-shade-a: .55; --fx-shade-blur: 70px; --fx-shade-spread: 0px;
  --fx-lift-a: .22; --fx-lift-shade-a: .9;
  --fx-ring-inset: -16%; --fx-spin-blur: 14px; --fx-spin-lo: .58; --fx-spin-hi: .9;
  --fx-ring-2: #ffd24a;
  --fx-spark: #ffd27a; --fx-spark-2: #fff6d8; --fx-spark-3: #ffb45c; --fx-spark-glow-rgb: 255, 210, 122;
  --fx-spark-a: .85; --fx-arrow-a: .55;
  --fx-play-ring-rgb: 255, 255, 255; --fx-play-ring-a: .14; --fx-play-ring-hover-a: .18;
}

/* phones: a full-width CTA leaves ~16px to the screen edge, so the pulse ring stays inside it */
@media (max-width: 720px) {
  :where(:root), .fx-light, .fx-dark { --fx-pulse-w: 8px; --fx-pulse-scale: 1.015; }
}

/* ==========================================================================
   1. HERO ENTRANCE (funnel: heroRise 900ms, stagger 0 / 120 / 200ms)
   CSS only, plays once on load. Hero blocks only (it is not a scroll reveal).
   ========================================================================== */
@keyframes fxRise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
.fx-d1 { --fx-delay: 120ms; }
.fx-d2 { --fx-delay: 200ms; }
.fx-d3 { --fx-delay: 320ms; }
.fx-d4 { --fx-delay: 440ms; }

/* ==========================================================================
   2. GLOW HALO behind hero media (funnel: .hero-photo-glow + heroGlow 9s breathe,
      funnel.css .video-panel::before)
   Put on a wrapper that does NOT clip (no overflow:hidden). The media sits inside.
   ========================================================================== */
.fx-halo { position: relative; isolation: isolate; }
.fx-halo::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -6% -5% -9% -5%;
  background: radial-gradient(58% 50% at 50% 46%,
              rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-halo-a)), transparent 72%);
  filter: blur(var(--fx-halo-blur));
}
/* phones: no negative side inset, so the glow box can never cause sideways scroll */
@media (max-width: 720px) { .fx-halo::before { inset: -5% 0 -8% 0; } }
@keyframes fxBreathe { from { opacity: var(--fx-halo-lo); } to { opacity: 1; } }

/* ==========================================================================
   3. GLOWING VIDEO / MEDIA FRAME (funnel: .vsl + funnel.css .video-frame)
   Put on the clipped box that holds the <video>/<iframe>/<img>.
   ========================================================================== */
.fx-frame {
  border-radius: var(--fx-radius, 18px); overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(var(--fx-rim-rgb, var(--fx-glow, var(--fx-accent-rgb))), var(--fx-rim-a)),
    0 30px 80px -20px rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-frame-a)),
    0 24px var(--fx-shade-blur) var(--fx-shade-spread) rgba(var(--fx-shade-rgb, var(--fx-ink-rgb)), var(--fx-shade-a));
}

/* Round play button with a soft ring (funnel: .vsl-big, .yt-slot-play) */
.fx-play {
  box-shadow:
    0 18px 50px rgba(var(--fx-shade-rgb, var(--fx-ink-rgb)), .35),
    0 0 0 14px rgba(var(--fx-play-ring-rgb, var(--fx-glow, var(--fx-accent-rgb))), var(--fx-play-ring-a));
  transition: scale 160ms ease, box-shadow 160ms ease;
}
.fx-play:hover, .fx-play:focus-visible {
  box-shadow:
    0 22px 60px rgba(var(--fx-shade-rgb, var(--fx-ink-rgb)), .4),
    0 0 0 20px rgba(var(--fx-play-ring-rgb, var(--fx-glow, var(--fx-accent-rgb))), var(--fx-play-ring-hover-a));
}

/* ==========================================================================
   4. GLOWING CTA + PULSE (funnel: .cta-btn underglow, bookPulse 1.4s)
   .fx-cta   = static colored underglow (+ brighter on hover)
   .fx-pulse = breathes forever (funnel ran it after the VSL ended)
   .fx-nudge = breathes 3 times once it scrolls into view, then rests
   ========================================================================== */
.fx-cta {
  box-shadow: 0 var(--fx-cta-y) var(--fx-cta-blur) var(--fx-cta-spread)
              rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-cta-a));
}
.fx-cta:hover, .fx-cta:focus-visible {
  box-shadow: 0 calc(var(--fx-cta-y) + 4px) calc(var(--fx-cta-blur) + 8px) var(--fx-cta-spread)
              rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-cta-hover-a));
}
@keyframes fxPulse {
  0%, 100% {
    scale: 1;
    box-shadow: 0 var(--fx-cta-y) var(--fx-cta-blur) var(--fx-cta-spread) rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-cta-a)),
                0 0 0 0 rgba(var(--fx-glow, var(--fx-accent-rgb)), 0);
  }
  50% {
    scale: var(--fx-pulse-scale);
    box-shadow: 0 var(--fx-cta-y) var(--fx-cta-blur) var(--fx-cta-spread) rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-cta-a)),
                0 0 0 var(--fx-pulse-w) rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-pulse-a));
  }
}

/* "Click below" cue: sparkles + bouncing chevron (funnel: .click-cue, cueTwinkle, cueBounce) */
.fx-cue {
  position: relative; width: min(300px, 100%); min-height: 26px; margin: 8px auto 4px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.fx-cue-text {
  position: relative; font-weight: 800; letter-spacing: -0.2px; white-space: nowrap;
  font-size: clamp(14px, 1.15vw, 16px); color: var(--fx-accent); text-align: center;
}
.fx-cue-arrow {
  position: relative; flex: 0 0 auto; width: 11px; height: 11px; margin-top: -6px;
  border-right: 4px solid var(--fx-accent); border-bottom: 4px solid var(--fx-accent);
  border-radius: 3px; transform: rotate(45deg);
  filter: drop-shadow(0 0 10px rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-arrow-a)));
}
.fx-spark {
  position: absolute; width: 15px; height: 15px; pointer-events: none;
  background: var(--fx-spark, var(--fx-accent));
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  opacity: .9;
  filter: drop-shadow(0 0 7px rgba(var(--fx-spark-glow-rgb, var(--fx-glow, var(--fx-accent-rgb))), var(--fx-spark-a)));
}
.fx-sp1 { left: 4px;   top: 8px; }
.fx-sp2 { right: 6px;  top: 4px;     width: 17px; height: 17px; background: var(--fx-spark-2, var(--fx-accent)); --fx-delay: .38s; }
.fx-sp3 { left: 30px;  bottom: -6px; --fx-delay: .76s; }
.fx-sp4 { right: 34px; bottom: -8px; background: var(--fx-spark-3, var(--fx-accent)); --fx-delay: 1.14s; }
.fx-sp5 { left: 66px;  bottom: 16px; width: 14px; height: 14px; background: var(--fx-spark-2, var(--fx-accent)); --fx-delay: 1.52s; }
.fx-sp6 { right: 62px; bottom: 18px; width: 18px; height: 18px; --fx-delay: 1.9s; }
@keyframes fxTwinkle {
  0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); }
  35%      { opacity: 1; transform: scale(1) rotate(90deg); }
  60%      { opacity: 0; transform: scale(.5) rotate(140deg); }
}
@keyframes fxCueBounce {
  0%, 100% { translate: 0 0;   opacity: .8; }
  50%      { translate: 0 6px; opacity: 1; }
}
/* Generic down-bob for arrows / hand icons (funnel: handBob) */
@keyframes fxBob { 0%, 100% { translate: 0 0; } 50% { translate: 0 var(--fx-bob, 8px); } }

/* ==========================================================================
   5. KEN BURNS on photo bands (funnel: heroKen 18s alternate, scale 1.02 -> 1.09)
   Put on the clipping box; its direct <img>/<video> drifts.
   .fx-ken-melt adds the funnel's soft bottom fade into the page ground.
   ========================================================================== */
.fx-ken { position: relative; overflow: hidden; }
.fx-ken > img, .fx-ken > video, .fx-ken > picture > img { display: block; transform-origin: 50% 26%; }
@keyframes fxKen {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.09) translate3d(0, -1.4%, 0); }
}
.fx-ken-melt::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 26%; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--fx-bg-rgb), 0) 0%, rgba(var(--fx-bg-rgb), .55) 100%);
}

/* ==========================================================================
   6. SPINNING GLOW RING behind a round photo (funnel: Harrisson card .hb-glow,
      hbSpin 4s + hbPulse 2s, conic gradient blurred 14px, white core)
   Put on a non-clipping wrapper around a round <img>.
   ========================================================================== */
.fx-ring { position: relative; isolation: isolate; }
.fx-ring::before {
  content: ""; position: absolute; inset: var(--fx-ring-inset); border-radius: 50%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg,
    var(--fx-ring-1, var(--fx-accent)), var(--fx-ring-2), var(--fx-ring-3, var(--fx-accent)),
    var(--fx-ring-1, var(--fx-accent)), var(--fx-ring-2), var(--fx-ring-3, var(--fx-accent)),
    var(--fx-ring-1, var(--fx-accent)));
  filter: blur(var(--fx-spin-blur)); opacity: var(--fx-spin-hi);
}
.fx-ring::after {
  content: ""; position: absolute; inset: 4%; border-radius: 50%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%);
  filter: blur(6px);
}
@keyframes fxSpin { to { transform: rotate(360deg); } }
@keyframes fxRingPulse { from { opacity: var(--fx-spin-lo); } to { opacity: var(--fx-spin-hi); } }

/* ==========================================================================
   7. LINE / NUMBER EFFECTS (funnel: mkStrike, mkWin, mtDraw, n8Draw, n8Flow, mtFade)
   .fx-rule          accent divider that sweeps open left to right
   .fx-strike        inline word that gets struck through
   .fx-win           the payoff word that pops in after the strikes
   .fx-draw-host     wrapper/svg; its .fx-draw paths draw on (needs pathLength="1")
   .fx-fill          area under a drawn line, fades up after the draw
   .fx-flow          a bright dash that travels along a drawn path (loop)
   [data-fx-count]   number counts up once in view, ends on the exact original text
   ========================================================================== */
.fx-rule {
  display: block; height: var(--fx-rule-h, 2px); border: 0; border-radius: 2px;
  background: var(--fx-accent); transform-origin: left center;
}
.fx-strike { position: relative; display: inline-block; }
.fx-strike::after {
  content: ""; position: absolute; left: -3%; top: 52%; width: 106%; height: .09em; min-height: 2px;
  border-radius: 2px; background: var(--fx-strike, var(--fx-accent)); transform-origin: left center; pointer-events: none;
}
.fx-win { display: inline-block; }
.fx-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.fx-flow { stroke-dasharray: .05 1.05; stroke-linecap: round; }
@keyframes fxFlow { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -1.1; } }
[data-fx-count] { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   8. HOVER LIFT / TILT (funnel: .client-card, .presenter-card, .t-card)
   .fx-lift  card rises 6px, shadow deepens, accent glow underneath
   .fx-zoom  child media inside a .fx-lift scales 1.03 on hover
   .fx-tilt  photo tips toward the cursor (mouse only)
   ========================================================================== */
.fx-lift:hover, .fx-lift:focus-within {
  border-color: rgba(var(--fx-rim-rgb, var(--fx-glow, var(--fx-accent-rgb))), .32);
  box-shadow:
    0 22px 44px -18px rgba(var(--fx-shade-rgb, var(--fx-ink-rgb)), var(--fx-lift-shade-a)),
    0 12px 32px -6px rgba(var(--fx-glow, var(--fx-accent-rgb)), var(--fx-lift-a));
}

/* ==========================================================================
   9. MOTION (everything that moves). Reduced-motion users get none of this.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* 1. hero entrance */
  .fx-rise { animation: fxRise 900ms var(--fx-ease-out) var(--fx-delay, 0ms) both; }

  /* 2. halo breathing */
  .fx-halo::before { animation: fxBreathe 9s ease-in-out infinite alternate; }

  /* 3. play button grows on hover (individual `scale`, so a centering transform survives) */
  .fx-play:hover, .fx-play:focus-visible { scale: 1.06; }

  /* 4. pulse / nudge / cue */
  .fx-pulse { animation: fxPulse 1.4s ease-in-out infinite; }
  .fx-nudge.in { animation: fxPulse 1.4s ease-in-out 600ms 3; }
  .fx-cue-arrow { animation: fxCueBounce 1.5s var(--fx-ease-bob) infinite; }
  .fx-spark { opacity: 0; transform: scale(.25); animation: fxTwinkle 2.2s ease-in-out var(--fx-delay, 0s) infinite; }
  .fx-bob { animation: fxBob 1.5s var(--fx-ease-bob) infinite; }

  /* 5. Ken Burns */
  .fx-ken > img, .fx-ken > video, .fx-ken > picture > img {
    will-change: transform; animation: fxKen 18s ease-in-out infinite alternate;
  }

  /* 6. spinning ring */
  .fx-ring::before { animation: fxSpin 4s linear infinite, fxRingPulse 2s ease-in-out infinite alternate; }

  /* 7a. unified transition for every revealable / hoverable kit element */
  .fx-reveal, .fx-stagger > *, .fx-lift, .fx-tilt {
    transition:
      translate var(--fx-rev-dur, 820ms) var(--fx-ease-out) var(--fx-delay, 0ms),
      scale     var(--fx-rev-dur, 820ms) var(--fx-rev-scale-ease, var(--fx-ease-out)) var(--fx-delay, 0ms),
      filter    var(--fx-rev-dur, 820ms) var(--fx-ease-out) var(--fx-delay, 0ms),
      opacity   var(--fx-rev-dur, 820ms) var(--fx-ease-out) var(--fx-delay, 0ms),
      transform 280ms var(--fx-ease-lift),
      box-shadow 280ms ease,
      border-color 280ms ease;
  }
  .fx-stagger > * { --fx-rev-dur: 620ms; --fx-rev-scale-ease: var(--fx-ease-pop); }

  /* 7b. scroll-reveal PRE-STATES: visible, never opacity 0, only with JS on */
  html.fx-js .fx-reveal:not(.in) {
    translate: 0 var(--fx-rev-y, 26px); scale: .975; filter: blur(var(--fx-rev-blur, 3px)); opacity: .6;
  }
  html.fx-js .fx-stagger:not(.in) > * {
    translate: 0 18px; scale: .96; filter: blur(var(--fx-rev-blur, 2px)); opacity: .6;
  }
  @media (min-width: 821px) {
    html.fx-js .fx-reveal.fx-from-left:not(.in)  { translate: -36px 0; }
    html.fx-js .fx-reveal.fx-from-right:not(.in) { translate: 36px 0; }
  }

  /* 7c. lines + numbers */
  .fx-rule { transition: scale 900ms var(--fx-ease-strike) var(--fx-delay, 0ms); }
  html.fx-js .fx-rule:not(.in) { scale: .06 1; }

  .fx-strike::after { transition: scale 620ms var(--fx-ease-strike) var(--fx-delay, 0ms); }
  html.fx-js .fx-strike:not(.in)::after { scale: 0 1; }

  .fx-win { transition: scale 660ms var(--fx-ease-win) var(--fx-delay, 0ms), opacity 420ms ease var(--fx-delay, 0ms); }
  html.fx-js .fx-win:not(.in) { scale: .62; opacity: .35; }

  .fx-draw { transition: stroke-dashoffset var(--fx-draw-dur, 1600ms) var(--fx-ease-draw) var(--fx-delay, 0ms); }
  html.fx-js .fx-draw-host:not(.in) .fx-draw { stroke-dashoffset: 1; }
  .fx-fill { transition: opacity 900ms ease calc(var(--fx-delay, 0ms) + 700ms); }
  html.fx-js .fx-draw-host:not(.in) .fx-fill { opacity: .15; }
  .fx-flow { animation: fxFlow 2.6s linear calc(var(--fx-delay, 0ms) + var(--fx-draw-dur, 1600ms)) infinite; }
  html.fx-js .fx-draw-host:not(.in) .fx-flow { animation-play-state: paused; opacity: 0; }

  /* 8. hover motion */
  @media (hover: hover) {
    .fx-lift:hover, .fx-lift:focus-within { transform: translateY(-6px); }
    .fx-lift .fx-zoom { transition: transform 500ms var(--fx-ease-lift); }
    .fx-lift:hover .fx-zoom { transform: scale(var(--fx-zoom, 1.03)); }
  }
  @media (hover: hover) and (pointer: fine) {
    .fx-tilt:hover { transform: perspective(900px) rotateX(2.5deg) rotateY(-3deg) translateY(-4px); }
  }

  /* loops inside .fx-park wait until it is on screen (funnel: [data-viz] -> .is-live) */
  html.fx-js .fx-park:not(.in),
  html.fx-js .fx-park:not(.in) *,
  html.fx-js .fx-park:not(.in) *::before,
  html.fx-js .fx-park:not(.in) *::after { animation-play-state: paused; }
}

/* ==========================================================================
   10. PAUSE CONTROL (funnel: .motion-toggle, WCAG 2.2.2). Any [data-fx-toggle]
       button toggles html.fx-paused through fx-kit.js.
   ========================================================================== */
html.fx-paused *, html.fx-paused *::before, html.fx-paused *::after { animation-play-state: paused !important; }
.fx-motion-toggle {
  position: fixed; left: 14px; bottom: 14px; z-index: 998;
  width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--fx-bg-rgb), .86); color: var(--fx-ink);
  border: 1px solid rgba(var(--fx-ink-rgb), .22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.fx-motion-toggle svg { width: 16px; height: 16px; display: block; fill: currentColor; }
.fx-motion-toggle .fx-i-play { display: none; }
html.fx-paused .fx-motion-toggle .fx-i-play { display: block; }
html.fx-paused .fx-motion-toggle .fx-i-pause { display: none; }
