/* Torvello motion & effects layer. Loads after site.css.
   Everything here is progressive: remove fx.css and fx.js and the page still works, just without motion. */

/* ---------- scroll progress ---------- */
.fx-prog{position:fixed;inset:env(safe-area-inset-top,0px) 0 auto;height:3px;z-index:50;background:linear-gradient(90deg,var(--amber),#FFD666);transform-origin:left;transform:scaleX(0);pointer-events:none;box-shadow:0 0 12px rgba(245,176,0,.6)}

/* ---------- button shine ---------- */
.btn::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.35) 50%,transparent 80%);transform:translateX(-120%);transition:transform .7s var(--ease)}
.btn:hover::before{transform:translateX(120%)}
.btn.ghost::before{background:linear-gradient(100deg,transparent 20%,rgba(255,255,255,.12) 50%,transparent 80%)}

/* ---------- card hover lift ---------- */
.find,.factor,.panel,.stat{transition:transform .45s var(--ease),box-shadow .45s var(--ease),border-color .3s}
.find:hover,.factor:hover{transform:translateY(-6px);box-shadow:var(--shadow-3);border-color:var(--line-strong)}
.outcomes div{transition:background-color .3s}
.outcomes div:hover{background:color-mix(in srgb,var(--amber) 9%,var(--surface))}

/* ---------- spotlight on cards (pointer follows) ---------- */
.spot{position:relative}
.spot::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity .35s;
  background:radial-gradient(420px circle at var(--mx,50%) var(--my,50%),rgba(245,176,0,.10),transparent 45%)}
.spot:hover::before{opacity:1}

/* ---------- tab panel switch ---------- */
.js-tabs .panel[hidden]{display:none!important}
.js-tabs .panel.enter{animation:fx-panel .55s var(--ease) both}

/* ---------- marquee ---------- */
.marq-track{animation:fx-marq 38s linear infinite}
.marq:hover .marq-track{animation-play-state:paused}

/* ---------- live "you" row pulse ---------- */
.row.you .tag.you{position:relative}

@media (prefers-reduced-motion:no-preference){
  @keyframes fx-rise{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:none}}
  @keyframes fx-in-right{from{opacity:0;transform:translateY(30px) rotate(1.2deg) scale(.98)}to{opacity:1;transform:none}}
  @keyframes fx-row{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
  @keyframes fx-mark{from{background-size:0% 100%}to{background-size:100% 100%}}
  @keyframes fx-pulse{0%{box-shadow:inset 0 0 0 0 rgba(245,176,0,.8)}70%{box-shadow:inset 0 0 0 8px rgba(245,176,0,0)}100%{box-shadow:inset 0 0 0 0 rgba(245,176,0,0)}}
  @keyframes fx-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
  @keyframes fx-chip{from{opacity:0;transform:translateY(14px) scale(.94)}to{opacity:1;transform:none}}
  @keyframes fx-panel{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
  @keyframes fx-marq{to{transform:translate3d(-50%,0,0)}}
  @keyframes fx-bump{0%{transform:scale(1)}40%{transform:scale(1.06)}100%{transform:scale(1)}}

  /* hero entrance */
  .hero .hero-badge{animation:fx-rise .8s var(--ease) both}
  .hero h1{animation:fx-rise .9s var(--ease) .06s both}
  .hero .lede{animation:fx-rise .9s var(--ease) .2s both}
  .hero .cta-row{animation:fx-rise .9s var(--ease) .32s both}
  .hero .hero-meta{animation:fx-rise .9s var(--ease) .42s both}
  .hero .area{animation:fx-rise .9s var(--ease) .5s both}
  .hero h1 .mark{animation:fx-mark .8s var(--ease) .7s both}
  .hero .pack{animation:fx-in-right 1.1s var(--ease) .22s both}
  .hero .pack>.row,.hero .pack>.gap-row{animation:fx-row .6s var(--ease) both}
  .hero .pack>:nth-child(2){animation-delay:.65s}.hero .pack>:nth-child(3){animation-delay:.75s}.hero .pack>:nth-child(4){animation-delay:.85s}
  .hero .pack>:nth-child(5){animation-delay:.95s}.hero .pack>:nth-child(6){animation-delay:1.05s}
  .hero .pack>.row.you{animation:fx-row .7s var(--ease) 1.25s both,fx-pulse 2.2s ease-out 2.1s 3}
  .chip-a{animation:fx-chip .8s var(--ease) 1.5s both,fx-float 6s ease-in-out 2.4s infinite}
  .chip-b{animation:fx-chip .8s var(--ease) 1.75s both,fx-float 7s ease-in-out 2.8s infinite}
  .phero .crumbs{animation:fx-rise .7s var(--ease) both}
  .phero .eyebrow{animation:fx-rise .8s var(--ease) .05s both}
  .phero h1{animation:fx-rise .9s var(--ease) .1s both}
  .phero .lede{animation:fx-rise .9s var(--ease) .22s both}
  .phero .cta-row{animation:fx-rise .9s var(--ease) .32s both}
  .phero .facts{animation:fx-in-right 1s var(--ease) .25s both}
  .phero h1 .mark{animation:fx-mark .8s var(--ease) .6s both}
  html.fx .tile.rv.in:hover,html.fx .read.rv.in:hover{transform:translateY(-6px)}
  html.fx .pick.rv.in:hover{transform:translateY(-6px)}
  html.fx .b.rv.in:hover{transform:translateY(-4px)}
  html.fx .pick.rv,html.fx .b.rv{transition:opacity .9s var(--ease),transform .6s var(--ease),box-shadow .45s var(--ease),border-color .3s,color .3s;transition-delay:var(--d,0s),0s,0s,0s,0s}
  .contact.top .crumbs,.contact.top .eyebrow{animation:fx-rise .7s var(--ease) both}
  .contact.top h1{animation:fx-rise .9s var(--ease) .08s both}
  .contact.top .card{animation:fx-in-right 1s var(--ease) .2s both}
  .phero .art-meta{animation:fx-rise .9s var(--ease) .3s both}
  html.fx .town.rv.in:hover,html.fx .deliv li.rv.in:hover{transform:translateY(-3px)}
  html.fx .tile.rv,html.fx .read.rv,html.fx .town.rv,html.fx .deliv li.rv{transition:opacity .9s var(--ease),transform .6s var(--ease),box-shadow .45s var(--ease),border-color .3s;transition-delay:var(--d,0s),0s,0s,0s}
  .trust li{animation:fx-rise .8s var(--ease) both}
  .trust li:nth-child(1){animation-delay:.55s}.trust li:nth-child(2){animation-delay:.62s}.trust li:nth-child(3){animation-delay:.69s}.trust li:nth-child(4){animation-delay:.76s}.trust li:nth-child(5){animation-delay:.83s}

  /* scroll reveals (classes added by fx.js only when IntersectionObserver is available) */
  html.fx .rv{opacity:0;transform:translateY(32px);transition:opacity .9s var(--ease),transform .9s var(--ease);transition-delay:var(--d,0s)}
  html.fx .rv.in{opacity:1;transform:none}
  html.fx .sec-head h2.rv{transform:translateY(46px)}
  html.fx .sec-head h2.rv.in{transform:none}
  html.fx .eyebrow.rv::before{transform:rotate(45deg) scale(0);transition:transform .6s var(--ease) .25s}
  html.fx .eyebrow.rv.in::before{transform:rotate(45deg) scale(1)}

  /* hover lift needs to win over the reveal transform once revealed */
  html.fx .find.rv.in:hover,html.fx .factor.rv.in:hover{transform:translateY(-6px)}
  html.fx .rules li.rv.in:hover{transform:translateY(-4px)}
  html.fx .trades a.rv.in:hover{transform:translateY(-3px)}
  html.fx .find.rv,html.fx .factor.rv,html.fx .rules li.rv,html.fx .trades a.rv{transition:opacity .9s var(--ease),transform .6s var(--ease),box-shadow .45s var(--ease),border-color .3s,background-color .3s,color .3s;transition-delay:var(--d,0s),0s,0s,0s,0s,0s}

  /* meters fill */
  html.fx .factor .meter i.on{transform:scaleX(0);transform-origin:left;transition:transform .7s var(--ease)}
  html.fx .factor.in .meter i.on{transform:scaleX(1)}
  html.fx .factor.in .meter i:nth-child(2){transition-delay:.12s}html.fx .factor.in .meter i:nth-child(3){transition-delay:.24s}html.fx .factor.in .meter i:nth-child(4){transition-delay:.36s}

  /* process line draws */
  html.fx .steps::after{transform:scaleX(0);transition:transform 1.6s var(--ease) .3s}
  html.fx .steps.in::after{transform:scaleX(1)}
  html.fx .steps .step-n{transform:scale(.6);opacity:0;transition:transform .7s var(--ease),opacity .5s,border-color .3s}
  html.fx .steps.in li .step-n{transform:none;opacity:1}
  html.fx .steps.in li:nth-child(1) .step-n{transition-delay:.1s}
  html.fx .steps.in li:nth-child(2) .step-n{transition-delay:.7s}
  html.fx .steps.in li:nth-child(3) .step-n{transition-delay:1.3s}
  html.fx .steps.in li:hover .step-n{transform:translateY(-4px) rotate(-4deg);transition-delay:0s}

  /* calculator result bump */
  .bump{animation:fx-bump .35s var(--ease)}
}
@media (max-width:760px) and (prefers-reduced-motion:no-preference){
  html.fx .steps::after{transform:scaleY(0)}
  html.fx .steps.in::after{transform:scaleY(1)}
}
@media (prefers-reduced-motion:reduce){
  .marq-track{animation:none}
  .fx-prog{display:none}
}
