/* ============================================================
   BULBVPN landing — enhance.css   (additive polish layer)
   Loads AFTER each page's own stylesheet. Nothing here changes any
   static position, size, colour, copy or font: every resting / final
   frame equals the shipped Figma-matched state.

   Safety model
   ------------
   * Every hidden-from-state + ambient / entrance / float loop is gated
     behind `html.bv-on`, which enhance.js adds ONLY when JS runs AND
     reduced-motion is not requested. So: no JS, reduced-motion, or a
     frozen capture that never armed  =>  no `.bv-on`  =>  pixel-perfect
     static page (nothing hidden, nothing moving).
   * Hover / :active / :focus-visible / ::selection are pure CSS,
     interaction-triggered, and revert 1:1 on mouse-leave / blur.
   * GPU-only: transform / opacity / filter. No layout props animated,
     no reflow on scroll.
   * Never touches .fit/.fit-d/.fit-t/.bp-d/.bp-t/.bp-p/.canvas.
   * Never overrides the .dm/.inter translateY(0.35em) baseline nudge
     nor the phone .pp --u positioning: text is revealed opacity-only
     (logo) or rides a self-contained container (m-card/m-feat/kb-illus).
   * Glow colours are the tokens.css brand palette expressed with alpha:
     purple --c-purple #c547ff = 197,71,255 · cyan --c-cyan #51dcff =
     81,220,255 · plan-lime #84ff00 = 132,255,0.
   ============================================================ */

:root{
  --bv-ease-out:  cubic-bezier(.16,1,.3,1);
  --bv-ease-soft: cubic-bezier(.2,.8,.2,1);
}

/* ---------------------------------------------------------------
   1. SCROLL-REVEAL — self-contained containers only.
   .m-card / .m-feat carry their content as CHILDREN and .kb-illus
   wraps its own <img>, so translate/scale moves the whole unit with
   zero desync against the page's flat absolutely-positioned text.
   (Desktop/tablet "cards" are bare background rectangles whose text
   lives in separate absolute siblings, so they are deliberately NOT
   revealed — sliding them would detach them from their labels.)
   --------------------------------------------------------------- */
.bv-on .bv-rev{
  opacity:0;
  transform:translateY(16px) scale(.988);
  transition:opacity .6s var(--bv-ease-out), transform .6s var(--bv-ease-out);
  transition-delay:calc(var(--bv-i,0) * 80ms);
  will-change:opacity, transform;
}
.bv-on .bv-rev.bv-in{
  opacity:1;
  transform:none;
  will-change:auto;
}

/* ---------------------------------------------------------------
   2. HEADER NAV ENTRANCE (marketing pages) — one-shot cascade.
   `header nav a` = the 6 nav anchors (4 pills + login + buy); none
   carry a baseline nudge. account.html has no <nav> inside <header>,
   so it is untouched. .logo-text is faded OPACITY-ONLY so its
   translateY(0) nudge opt-out transform is never overwritten.
   --------------------------------------------------------------- */
.bv-on header nav a{
  opacity:0;
  animation:bv-nav-in .52s var(--bv-ease-out) both;
  animation-delay:calc(var(--bv-n,0) * 60ms + 60ms);
}
.bv-on header nav a:nth-child(1){--bv-n:1}
.bv-on header nav a:nth-child(2){--bv-n:2}
.bv-on header nav a:nth-child(3){--bv-n:3}
.bv-on header nav a:nth-child(4){--bv-n:4}
.bv-on header nav a:nth-child(5){--bv-n:5}
.bv-on header nav a:nth-child(6){--bv-n:6}
@keyframes bv-nav-in{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

.bv-on .logo-text{opacity:0;animation:bv-fade .5s ease .04s both}
@keyframes bv-fade{from{opacity:0}to{opacity:1}}

/* ---------------------------------------------------------------
   3. AMBIENT BREATHING GLOW — bulb illustrations.
   Dashboard halo animates opacity + brightness only; the blur RADIUS
   stays pinned to each breakpoint's authored value via a custom prop,
   so nothing jumps at animation start on the fluid phone canvas.
   --------------------------------------------------------------- */
.bv-on .ac-glow{
  --bv-glowb:34.5px;
  animation:bv-bulb 5.2s var(--bv-ease-soft) infinite;
  will-change:filter, opacity;
}
.bv-on .bp-p .ac-glow{--bv-glowb:calc(34.5 * var(--u))}
@keyframes bv-bulb{
  0%,100%{opacity:.92;filter:blur(var(--bv-glowb)) brightness(1)}
  50%    {opacity:1;  filter:blur(var(--bv-glowb)) brightness(1.2)}
}
/* home hero bulb illustration (desktop + tablet) — soft brand halo.
   0%/100% = fully transparent 0-blur shadow == flat static frame. */
.bv-on img[src$="vpn-illustration.png"]{animation:bv-hero-halo 5.6s var(--bv-ease-soft) infinite}
@keyframes bv-hero-halo{
  0%,100%{filter:drop-shadow(0 0 0 rgba(197,71,255,0))}
  50%    {filter:drop-shadow(0 0 22px rgba(197,71,255,.40)) drop-shadow(0 0 34px rgba(81,220,255,.22))}
}

/* ---------------------------------------------------------------
   4. AMBIENT BREATHING GLOW — one primary CTA per page.
   filter-only, so it never collides with the transform-based hover;
   0%/100% frames are alpha-0 => rest frame == flat static button.
   --------------------------------------------------------------- */
.bv-on .btn-buy    {animation:bv-glow-p 3.8s var(--bv-ease-soft) infinite}
.bv-on .p-buy--best{animation:bv-glow-l 3.6s var(--bv-ease-soft) infinite}
.bv-on .ac-btn     {animation:bv-glow-c 3.9s var(--bv-ease-soft) infinite}
.bv-on .m-cta      {animation:bv-glow-l 3.7s var(--bv-ease-soft) infinite}
@keyframes bv-glow-p{0%,100%{filter:drop-shadow(0 0 0 rgba(197,71,255,0))}50%{filter:drop-shadow(0 0 12px rgba(197,71,255,.50))}}
@keyframes bv-glow-l{0%,100%{filter:drop-shadow(0 0 0 rgba(132,255,0,0))}  50%{filter:drop-shadow(0 0 14px rgba(132,255,0,.50))}}
@keyframes bv-glow-c{0%,100%{filter:drop-shadow(0 0 0 rgba(81,220,255,0))} 50%{filter:drop-shadow(0 0 13px rgba(81,220,255,.50))}}

/* ---------------------------------------------------------------
   5. GENTLE FLOAT — standalone decorative elements (offset phases).
   Both are lone objects with clear space around them (astronaut art;
   circular server flag) and no static transform, so a 6px drift never
   detaches from or clips against neighbours. Rest frame = translateY(0).
   --------------------------------------------------------------- */
.bv-on .m-why__img{animation:bv-float 6s   var(--bv-ease-soft) infinite;will-change:transform}
.bv-on .ac-flag   {animation:bv-float 6.6s var(--bv-ease-soft) .5s infinite;will-change:transform}
@keyframes bv-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}

/* ---------------------------------------------------------------
   6. HOVER / PRESS MICRO-INTERACTIONS (pure CSS).
   Scoped to self-contained interactive controls only — every one
   carries its label as a CHILD, so lift/scale can't desync. .m-cta
   re-composes its static translateX(-50%) centring in each transform.
   Hover gated to fine-pointer + motion-OK; press kept for touch taps
   when motion is allowed.
   --------------------------------------------------------------- */
.pill,.btn-login,.btn-buy,.p-buy,.ac-btn,.m-card__buy,.m-cta{
  transition:transform .2s var(--bv-ease-soft), box-shadow .2s ease;
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .pill:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 6px 18px -6px rgba(197,71,255,.50)}
  .btn-login:hover{transform:translateY(-2px);box-shadow:0 6px 16px -6px rgba(0,0,0,.28)}
  .btn-buy:hover,.p-buy:hover,.ac-btn:hover,.m-card__buy:hover{transform:translateY(-2px) scale(1.02)}
  .m-cta:hover{transform:translateX(-50%) translateY(-2px) scale(1.02)}
}
@media (prefers-reduced-motion:no-preference){
  .pill:active,.btn-login:active,.btn-buy:active,.p-buy:active,.ac-btn:active,.m-card__buy:active{transform:scale(.97);transition-duration:.1s}
  .m-cta:active{transform:translateX(-50%) scale(.97);transition-duration:.1s}
}

/* ---------------------------------------------------------------
   7. FOCUS-VISIBLE polish (additive — the base 3px purple outline is
   preserved). Soft brand ring via box-shadow on controls that carry
   no static shadow (m-cta is intentionally excluded — it already
   ships its own neon box-shadow). Kill the grey mobile tap flash.
   --------------------------------------------------------------- */
a,button{-webkit-tap-highlight-color:transparent}
.pill:focus-visible,.btn-login:focus-visible,.btn-buy:focus-visible,
.p-buy:focus-visible,.ac-btn:focus-visible,.m-card__buy:focus-visible{
  box-shadow:0 0 0 4px rgba(197,71,255,.28);
}

/* ---------------------------------------------------------------
   8. SITEWIDE TOUCHES — brand text-selection + smooth anchor scroll.
   --------------------------------------------------------------- */
::selection{background:var(--c-purple);color:#fff}
::-moz-selection{background:var(--c-purple);color:#fff}
html{scroll-behavior:smooth}

/* ---------------------------------------------------------------
   REDUCED MOTION — hard stop. Everything renders at its static frame;
   nothing hidden, nothing moving. Written WITHOUT the .bv-on prefix so
   it also catches a motion-preference change made after arming.
   --------------------------------------------------------------- */
@media (prefers-reduced-motion:reduce){
  .bv-rev{opacity:1 !important;transform:none !important;transition:none !important}
  header nav a,.logo-text{opacity:1 !important;animation:none !important}
  .ac-glow,
  img[src$="vpn-illustration.png"],
  .btn-buy,.p-buy--best,.ac-btn,.m-cta,
  .m-why__img,.ac-flag{animation:none !important}
  .pill,.btn-login,.btn-buy,.p-buy,.ac-btn,.m-card__buy,.m-cta{transition:none !important}
  html{scroll-behavior:auto}
}
