/* pr-ambient.css — "Living sky": the fleet's ambient layer (4 Dec 2026).
   Canonical template: tools/ambient/ambient.template.css. Built per site by tools/ambient/build.py, which stamps the class
   prefix (rk / pr), each design's own selector map and the site's sky palette.
   The stars and constellation lines are drawn by pr-sky.js on one fixed canvas, screen-blended so they only appear on dark
   grounds. This file is the CSS half: aurora breath in the hero, a slowly turning lotus mandala behind each illustration,
   light that follows the cursor, the hero entrance, card glow, a staggered cascade after each section reveals, a sheen on the
   primary button and a reading-progress line. Nothing here hides content unless the lead JS has marked a section revealed.
   Motion runs regardless of the OS power setting (owner's instruction, 4 Dec 2026): no prefers-reduced-motion gate here. */

:root{--sky1:#ecd283;--sky2:#fff8e1;--sky3:#c9a7ff;--amb:cubic-bezier(.2,.7,.2,1)}

/* ---------- the sky itself (pr-sky.js creates the canvas) ---------- */
.pr-sky{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:5;mix-blend-mode:screen;contain:strict;animation:rkSkyIn 1.8s ease both}
@keyframes rkSkyIn{from{opacity:0}to{opacity:1}}
/* surfaces sit above the sky, so lines never run across something being read */
:is(.pr-tile,.pr-xc,.pr-pl,.pr-price,.pr-tool,.pr-qr,.pr-portrait,.pr-facts,.pr-stats-in a,.pr-ftform){position:relative;z-index:6}
@media print{.pr-sky,.pr-progress{display:none}}

/* ---------- reading progress ---------- */
.pr-progress{position:fixed;left:0;top:0;width:100%;height:2px;z-index:60;pointer-events:none;transform:scaleX(0);transform-origin:0 50%;opacity:0;
  background:linear-gradient(90deg,color-mix(in srgb,var(--sky1) 40%,transparent),var(--sky1));transition:opacity .4s ease}
.pr-progress.pr-on{opacity:.9}

/* ---------- hero: aurora breath + light that follows the cursor ---------- */
.pr-hero{isolation:isolate;--mx:62%;--my:40%}
.pr-hero::before{content:"";position:absolute;inset:4% 6%;z-index:-1;pointer-events:none;
  background:radial-gradient(42% 48% at 80% 46%,color-mix(in srgb,var(--ac) 20%,transparent),transparent 72%),
             radial-gradient(38% 44% at 8% 92%,color-mix(in srgb,var(--sky3) 13%,transparent),transparent 72%),
             radial-gradient(56% 56% at 44% 4%,rgba(255,255,255,.07),transparent 70%);
  animation:rkAurora 26s ease-in-out infinite alternate}
.pr-hero::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:0;transition:opacity .9s ease;
  background:radial-gradient(560px circle at var(--mx) var(--my),color-mix(in srgb,var(--ac) 15%,transparent),transparent 64%)}
.pr-hero.pr-lit::after{opacity:1}

/* ---------- hero art: a lotus mandala turning once every few minutes, and a halo that breathes ---------- */
.pr-eyecol::before{content:"";position:absolute;inset:-22% -18%;z-index:0;pointer-events:none;opacity:.46;
  background:var(--ac);
  -webkit-mask:url(/assets/mandala.svg?v=29939929) center/contain no-repeat,radial-gradient(closest-side,transparent 36%,#000 60%);
          mask:url(/assets/mandala.svg?v=29939929) center/contain no-repeat,radial-gradient(closest-side,transparent 36%,#000 60%);
  -webkit-mask-composite:source-in;mask-composite:intersect;
  animation:rkSpin 160s linear infinite}
.pr-eyecol::after{content:"";position:absolute;inset:-8%;z-index:0;pointer-events:none;
  background:radial-gradient(closest-side,color-mix(in srgb,var(--ac) 30%,transparent),transparent 74%);
  animation:rkBreath 9s ease-in-out infinite alternate}
.pr-eyecol>svg{position:relative;z-index:1;translate:calc(var(--px,0)*12px) calc(var(--py,0)*10px);transition:translate .9s var(--amb);
  animation:rkFloat 7s ease-in-out infinite alternate}

/* ---------- the last call and the dark sections between: a quieter version of the same light ---------- */
:is(.pr-void,.pr-indigo,.pr-royal,.pr-night):not(.pr-hero):not(.pr-final)::before{content:"";position:absolute;inset:4% 6%;pointer-events:none;z-index:0;
  background:radial-gradient(50% 60% at 12% 18%,color-mix(in srgb,var(--ac) 12%,transparent),transparent 70%),
             radial-gradient(46% 56% at 90% 84%,color-mix(in srgb,var(--sky3) 11%,transparent),transparent 70%);
  animation:rkAurora 36s ease-in-out infinite alternate}
.pr-final{isolation:isolate}
.pr-final::before{content:"";position:absolute;inset:4% 6%;z-index:-1;pointer-events:none;
  background:radial-gradient(46% 52% at 50% 42%,color-mix(in srgb,var(--ac) 18%,transparent),transparent 70%);
  animation:rkBreath 11s ease-in-out infinite alternate}
.pr-final>svg{animation:rkRot 170s linear infinite;transform-origin:50% 50%}

/* ---------- light sections: a slow wash of warm and rose light ---------- */
:is(.pr-cream,.pr-sand):not(.pr-hero)::before{content:"";position:absolute;inset:4% 6%;pointer-events:none;z-index:0;
  background:radial-gradient(46% 54% at 88% 14%,color-mix(in srgb,var(--gold) 16%,transparent),transparent 70%),
             radial-gradient(42% 48% at 8% 88%,color-mix(in srgb,#c9a7e8 22%,transparent),transparent 70%);
  animation:rkHaze 40s ease-in-out infinite alternate}

/* ---------- the hero arrives once: headline, lead, buttons, art ---------- */
.pr-hero .pr-h1,.pr-hero .pr-lead,.pr-hero .pr-row,.pr-hero .pr-eyecol{animation:rkRise 1.05s var(--amb) both}
.pr-hero .pr-h1{animation-delay:.06s}.pr-hero .pr-lead{animation-delay:.2s}.pr-hero .pr-row{animation-delay:.34s}.pr-hero .pr-eyecol{animation-delay:.16s}
@supports ((-webkit-background-clip:text) or (background-clip:text)){
  .pr-hero .pr-h1 em{background:linear-gradient(105deg,var(--ac) 0%,var(--ac) 40%,var(--sky2) 50%,var(--ac) 60%,var(--ac) 100%);
    background-size:260% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
    animation:rkShimmer 9s ease-in-out 1.4s infinite}
}
@media print{.pr-hero .pr-h1 em{background:none;color:var(--ac);-webkit-text-fill-color:currentColor}}

/* ---------- after a section reveals, its cards follow one another ---------- */
.pr-sin:is(.pr-bento,.pr-steps,.pr-pledge,.pr-qs,.pr-tools,.pr-xcards)>*,.pr-sin :is(.pr-bento,.pr-steps,.pr-pledge,.pr-qs,.pr-tools,.pr-xcards)>*{animation:rkRise .8s var(--amb) backwards;animation-delay:calc(var(--i,0)*80ms + 120ms)}
.pr-sec :is(.pr-bento,.pr-steps,.pr-pledge,.pr-qs,.pr-tools,.pr-xcards)>:nth-child(2){--i:1}
.pr-sec :is(.pr-bento,.pr-steps,.pr-pledge,.pr-qs,.pr-tools,.pr-xcards)>:nth-child(3){--i:2}
.pr-sec :is(.pr-bento,.pr-steps,.pr-pledge,.pr-qs,.pr-tools,.pr-xcards)>:nth-child(4){--i:3}
.pr-sec :is(.pr-bento,.pr-steps,.pr-pledge,.pr-qs,.pr-tools,.pr-xcards)>:nth-child(n+5){--i:4}

/* ---------- cards that glow where you point (pr-sky.js marks the targets with .pr-glow) ---------- */
@media (hover:hover) and (pointer:fine){
  .pr-glow{isolation:isolate}
  .pr-glow::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:-1;opacity:0;transition:opacity .55s ease;
    background:radial-gradient(300px circle at var(--gx,50%) var(--gy,-20%),color-mix(in srgb,var(--ac) 17%,transparent),transparent 62%)}
  .pr-glow:hover::after,.pr-glow:focus-visible::after{opacity:1}
  .pr-cta{position:relative;overflow:hidden}
  .pr-cta::after{content:"";position:absolute;top:-45%;bottom:-45%;left:0;width:36%;pointer-events:none;opacity:0;transform:translateX(-170%) skewX(-20deg);
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent)}
  .pr-cta:hover::after,.pr-cta:focus-visible::after{opacity:1;animation:rkSheen .9s ease}
}

@keyframes rkAurora{from{transform:translate3d(-2.5%,-1.5%,0) scale(1)}to{transform:translate3d(2.5%,2%,0) scale(1.07)}}
@keyframes rkHaze{from{transform:translate3d(-2%,-1.5%,0) scale(1)}to{transform:translate3d(2%,2%,0) scale(1.05)}}
@keyframes rkSpin{to{transform:rotate(360deg)}}
@keyframes rkRot{to{rotate:360deg}}
@keyframes rkBreath{from{transform:scale(.94);opacity:.6}to{transform:scale(1.08);opacity:1}}
@keyframes rkFloat{from{transform:translateY(-5px)}to{transform:translateY(6px)}}
@keyframes rkRise{from{opacity:0;transform:translate3d(0,26px,0)}to{opacity:1;transform:none}}
@keyframes rkShimmer{0%,58%{background-position:120% 0}100%{background-position:-40% 0}}
@keyframes rkSheen{from{transform:translateX(-170%) skewX(-20deg)}to{transform:translateX(390%) skewX(-20deg)}}
