/* ============================================================
   ANIM LAYER — load curtain + orchestrated hero + scroll polish
   Additive & robust: hero entrance is pure CSS (plays on load),
   nothing depends on a body-state class that must be removed.
   The only JS job is lifting/removing the curtain (self-clears).
   ============================================================ */

/* ---------- 1 · LOAD CURTAIN ---------- */
.loadcurtain{ position:fixed; inset:0; z-index:9999; background:var(--bg);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:22px; }
.lc-mono{ width:54px; height:54px; }
.lc-mono img{ width:100%; height:100%; object-fit:contain; filter:brightness(0) invert(1);
  opacity:0; animation:lcMono 1s cubic-bezier(.16,1,.3,1) both; }
.lc-bar{ width:148px; height:2px; background:rgba(233,244,239,.12); border-radius:2px; overflow:hidden; }
.lc-bar i{ display:block; height:100%; width:0; background:var(--teal);
  box-shadow:0 0 10px var(--teal); }
.lc-label{ font-family:var(--mono); font-size:10px; letter-spacing:.42em; color:var(--fg-dim);
  text-transform:uppercase; opacity:0; animation:lcMono .9s ease both .15s; }
@keyframes lcMono{ 0%{ opacity:0; transform:translateY(8px) scale(.96); } 100%{ opacity:.92; transform:none; } }
@keyframes lcBar{ to{ width:100%; } }
/* exit — the curtain lifts like a blind */
.loadcurtain.out{ clip-path:inset(0 0 100% 0); transition:clip-path .82s cubic-bezier(.76,0,.24,1); }
.loadcurtain.out .lc-mono, .loadcurtain.out .lc-bar, .loadcurtain.out .lc-label{
  opacity:0; transform:translateY(-14px); transition:opacity .4s ease, transform .5s ease; }
.loadcurtain.gone{ display:none; }

/* On reload/return the curtain is hidden by default (no "Initializing" flash);
   it only appears if the page is genuinely slow to load — then as "Loading". */
html.rl-reload .loadcurtain{ display:none; }
html.rl-reload .loadcurtain.show-reload{ display:flex; }

/* ---------- 2 · HERO ENTRANCE (gated on curtain release: plays AFTER the bar) ---------- */
@keyframes heroRise{ 0%{ opacity:0; transform:translateY(16px); } 100%{ opacity:1; transform:none; } }
@keyframes navDrop{ 0%{ opacity:0; transform:translateY(-14px); } 100%{ opacity:1; transform:none; } }
@keyframes softIn{ from{ opacity:0; } to{ opacity:1; } }

/* While the curtain is up (body.intro): hold every entrance element hidden. */
body.intro .hero-eyebrow, body.intro .hero-sub, body.intro .hero-actions,
body.intro header.nav, body.intro .rail, body.intro .hvz-flow{
  opacity:0; animation:none !important; }
body.intro .hero-h1 .ln span{ transform:translateY(106%) !important; transition:none !important; }
body.intro #hero .vn[data-reveal]{ opacity:0 !important; transform:translate(-50%,-50%) scale(.96) !important; }

/* On release (body.content-in): the page rises in, staggered — delays are relative to the lift. */
body.content-in .hero-eyebrow{ animation:heroRise .8s cubic-bezier(.16,1,.3,1) both .12s; }
body.content-in .hero-sub{ animation:heroRise .8s cubic-bezier(.16,1,.3,1) both .42s; }
body.content-in .hero-actions{ animation:heroRise .8s cubic-bezier(.16,1,.3,1) both .54s; }
body.content-in header.nav{ animation:navDrop .75s cubic-bezier(.16,1,.3,1) both .04s; }
body.content-in .rail{ animation:softIn .9s ease both .62s; }
body.content-in .hvz-flow{ animation:softIn 1s ease both .66s; }

/* headline: the masked rise (.go is added by site.js) — fires as the blind lifts */
.hero-h1 .ln span{ transition:transform 1.05s cubic-bezier(.16,1,.3,1); }
body.content-in .hero-h1.go .ln:nth-child(1) span{ transition-delay:.12s; }
body.content-in .hero-h1.go .ln:nth-child(2) span{ transition-delay:.26s; }

/* hero viz streams in left→right, just behind the headline */
body.content-in #hero .v-sources[data-reveal]{ transition-delay:.20s; }
body.content-in #hero .v-pipeline[data-reveal]{ transition-delay:.30s; }
body.content-in #hero .v-warehouse[data-reveal]{ transition-delay:.40s; }
body.content-in #hero .v-lake[data-reveal]{ transition-delay:.46s; }
body.content-in #hero .v-delta[data-reveal]{ transition-delay:.52s; }
body.content-in #hero .v-lakehouse[data-reveal]{ transition-delay:.58s; }
body.content-in #hero .v-bi[data-reveal]{ transition-delay:.64s; }

/* ---------- 3 · SCROLL-REVEAL POLISH ---------- */
/* focus-in: generic reveals clear a soft blur as they rise (vn/an keep their own transitions) */
[data-reveal]{ transition:opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1),
               filter .9s cubic-bezier(.16,1,.3,1); filter:blur(6px); }
/* drop the filter entirely once revealed so elements don't sit on permanent GPU blur layers */
[data-reveal].in{ filter:none; }
.vn[data-reveal], .an[data-reveal]{ filter:none; }

/* directional rhythm on section headers */
.sec-idx[data-reveal]{ transform:translateX(-24px); }
.sec-idx[data-reveal].in{ transform:none; }
.sec-note[data-reveal]{ transform:translateX(22px); }
.sec-note[data-reveal].in{ transform:none; }

/* ---------- 4 · MICRO-INTERACTIONS ---------- */
.btn{ transition:transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, background .2s, border-color .2s; }
.btn.primary:hover{ transform:translateY(-2px); }
.brand .logo{ transition:transform .4s cubic-bezier(.16,1,.3,1); }
.brand:hover .logo{ transform:rotate(-8deg) scale(1.06); }

/* ---------- reduced motion: everything visible, no curtain, no entrance ---------- */
body.reduce .loadcurtain{ display:none !important; }
body.reduce .hero-eyebrow, body.reduce .hero-sub, body.reduce .hero-actions,
body.reduce header.nav, body.reduce .rail, body.reduce .hvz-flow{
  animation:none !important; opacity:1 !important; transform:none !important; }
body.reduce .hero-h1.go .ln span{ transition-delay:0s !important; }
body.reduce #hero .vn[data-reveal]{ transition-delay:0s !important; }
body.reduce [data-reveal]{ filter:none !important; }
@media (prefers-reduced-motion:reduce){
  .lc-mono img, .lc-bar i, .lc-label{ animation-duration:.01ms !important; }
}