/* ============================================================
   Pai Digital — ALIVE layer (Nov 11, 2026)
   Shared cinematic progressive-enhancement stylesheet.
   Pure enhancement: every rule is scoped under html.alv (added
   by alive.js only after it starts cleanly). If alive.js is
   absent or fails, pages render exactly as before.
   Motion uses transform/opacity/background-size only — no
   layout shift. Respects prefers-reduced-motion; animations
   pause while the tab is hidden (html.alv-paused).
   ============================================================ */

/* ---------- scroll reveal (headers + plain blocks) ---------- */
html.alv .alv-rv{
  opacity:0;
  transform:translateY(24px) scale(.995);
  transition:opacity .85s cubic-bezier(.22,.61,.21,1),
             transform .85s cubic-bezier(.22,.61,.21,1),
             background-size 1.1s cubic-bezier(.22,.61,.21,1) .15s;
}
html.alv .alv-rv.alv-in{opacity:1;transform:none}

/* section headers: a gold-to-emerald rule sweeps in underneath */
html.alv .sec-head,html.alv .cat-head{
  background-image:linear-gradient(90deg,rgba(201,170,109,.9),rgba(20,96,74,.55) 68%,rgba(20,96,74,0));
  background-repeat:no-repeat;
  background-position:0 100%;
  background-size:0% 3px;
}
html.alv .sec-head.alv-in{background-size:min(420px,72%) 3px}
html.alv .cat-head.alv-in{background-size:min(300px,64%) 3px}

/* ---------- ambient life: drifting light + rising sparkles ---------- */
.alv-ambient{position:fixed;inset:-10% -5%;z-index:1;pointer-events:none;overflow:hidden}
.alv-ambient::before,.alv-ambient::after{content:"";position:absolute;border-radius:50%}
.alv-ambient::before{
  width:46vmax;height:46vmax;left:-12vmax;top:-16vmax;
  background:radial-gradient(circle,rgba(201,170,109,.13),rgba(201,170,109,0) 65%);
  animation:alvDriftA 46s ease-in-out infinite alternate;
}
.alv-ambient::after{
  width:50vmax;height:50vmax;right:-14vmax;bottom:-18vmax;
  background:radial-gradient(circle,rgba(20,96,74,.12),rgba(20,96,74,0) 65%);
  animation:alvDriftB 58s ease-in-out infinite alternate;
}
@keyframes alvDriftA{to{transform:translate3d(9vmax,5vmax,0) scale(1.15)}}
@keyframes alvDriftB{to{transform:translate3d(-8vmax,-6vmax,0) scale(.92)}}
.alv-ambient i{
  position:absolute;bottom:-3vh;width:5px;height:5px;border-radius:50%;
  background:radial-gradient(circle,#F7E7B4,rgba(247,231,180,0) 70%);
  opacity:0;animation:alvRise linear infinite;
}
@keyframes alvRise{
  0%{transform:translate3d(0,0,0);opacity:0}
  12%{opacity:.7}
  85%{opacity:.45}
  100%{transform:translate3d(2.5vw,-108vh,0);opacity:0}
}

/* ---------- parallax on catalogue cover imagery ---------- */
html.alv img[data-alv-plx]{
  transform:translate3d(0,var(--alv-py,0px),0) scale(1.12);
  transition:transform .3s ease-out;
  will-change:transform;
}
html.alv .pcard:hover img.cover[data-alv-plx]{
  transform:translate3d(0,var(--alv-py,0px),0) scale(1.18);
}

/* ---------- primary CTA sheen (a slow, classy sweep) ---------- */
html.alv .btn-gold,html.alv .alv-sheen{position:relative;overflow:hidden}
html.alv .btn-gold::after,html.alv .alv-sheen::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(105deg,transparent 42%,rgba(255,255,255,.35) 50%,transparent 58%);
  transform:translateX(-130%);
  animation:alvSheen 6.5s ease-in-out infinite;
}
@keyframes alvSheen{0%,58%{transform:translateX(-130%)}88%,100%{transform:translateX(130%)}}

/* ---------- card micro-interactions (Batch 2) ---------- */
html.alv .card,html.alv .ext-card,html.alv .who-card,html.alv .tk-card{
  transition:transform .35s cubic-bezier(.22,.61,.21,1),box-shadow .35s ease;
}
html.alv .card:hover,html.alv .ext-card:hover,html.alv .who-card:hover,html.alv .tk-card:hover{
  transform:translateY(-3px);
}

/* ---------- free-offer pitch band (Batch 2; content, not enhancement —
   styled unconditionally so it reads correctly even if alive.js fails) --- */
.alv-pitch{
  margin:26px auto;max-width:880px;padding:20px 24px;text-align:center;
  background:linear-gradient(135deg,#0E2A21,#123528);color:#F6F2E9;
  border:1px solid rgba(233,210,159,.5);border-radius:18px;
  box-shadow:0 18px 44px rgba(12,16,17,.28);
  font:400 1rem/1.5 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
.alv-pitch-h{
  display:block;font-family:Georgia,"Times New Roman",serif;
  font-size:1.3rem;color:#E9D29F;margin-bottom:6px;
}
.alv-pitch p{margin:4px auto 6px;max-width:640px}
.alv-pitch-cta{
  display:inline-block;margin:10px 6px 2px;text-decoration:none;
  background:linear-gradient(135deg,#E9D29F,#C9AA6D);color:#231a05;
  font-weight:700;border-radius:999px;padding:10px 20px;
}
.alv-pitch-cta:hover{filter:brightness(1.06)}
.alv-pitch-alt{
  display:inline-block;margin:10px 6px 2px;color:#E9D29F;font-weight:600;
  text-decoration:underline;text-underline-offset:3px;
}
@media(max-width:640px){.alv-pitch{margin:20px 12px;padding:18px 16px}}

/* ---------- Lina launcher: soft pulse after idle ---------- */
html.alv .alv-pulse{animation:alvPulse 2.8s ease-in-out infinite}
@keyframes alvPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(201,170,109,.45)}
  50%{box-shadow:0 0 0 13px rgba(201,170,109,0)}
}

/* ---------- auto-offer card (Pai Digital Services) ---------- */
.alv-offer{
  position:fixed;left:16px;bottom:16px;z-index:55;max-width:324px;
  background:#0E2A21;color:#F6F2E9;
  border:1px solid rgba(233,210,159,.45);border-radius:16px;
  box-shadow:0 24px 60px rgba(12,16,17,.42);
  padding:16px 40px 16px 18px;
  font:400 .95rem/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  opacity:0;transform:translateY(18px);pointer-events:none;
  transition:opacity .5s ease,transform .5s cubic-bezier(.22,.61,.21,1);
}
.alv-offer.alv-show{opacity:1;transform:none;pointer-events:auto}
.alv-offer .alv-offer-h{font-family:Georgia,"Times New Roman",serif;font-size:1.12rem;color:#E9D29F}
.alv-offer p{margin:6px 0 0}
.alv-offer .alv-cta{
  display:inline-block;margin-top:11px;text-decoration:none;
  background:linear-gradient(135deg,#E9D29F,#C9AA6D);color:#231a05;
  font-weight:700;border-radius:999px;padding:9px 18px;
}
.alv-offer .alv-cta:hover{filter:brightness(1.05)}
.alv-offer-x{
  position:absolute;top:8px;right:10px;background:none;border:0;
  color:#C9CFCC;font-size:1.05rem;line-height:1;cursor:pointer;padding:4px;
}
@media(max-width:640px){.alv-offer{left:12px;right:12px;bottom:12px;max-width:none}}

/* ---------- pause everything while the tab is hidden ---------- */
html.alv-paused .alv-ambient,
html.alv-paused .alv-ambient::before,
html.alv-paused .alv-ambient::after,
html.alv-paused .alv-ambient i,
html.alv-paused .btn-gold::after,
html.alv-paused .alv-sheen::after,
html.alv-paused .alv-pulse{animation-play-state:paused!important}

/* ---------- reduced motion: the layer becomes static ---------- */
@media (prefers-reduced-motion: reduce){
  html.alv .alv-rv{opacity:1!important;transform:none!important;transition:none!important}
  html.alv .sec-head{background-size:min(420px,72%) 3px}
  html.alv .cat-head{background-size:min(300px,64%) 3px}
  .alv-ambient{display:none!important}
  html.alv .btn-gold::after,html.alv .alv-sheen::after{display:none!important}
  html.alv .card:hover,html.alv .ext-card:hover,html.alv .who-card:hover,html.alv .tk-card:hover{transform:none!important}
  html.alv img[data-alv-plx]{transform:none!important;transition:none!important}
  html.alv .alv-pulse{animation:none!important}
  .alv-offer{transition:none}
}
