/* Khaliswala effects: loader, leaf cursor, masked heading reveals, drifting particles, hero depth layers.
   Driven by assets/js/fx.js (all pages). Everything degrades to the plain site without JS / with "reduce motion". */

/* ---------- loader: cream page, the K mark fills up like a growing leaf (every page load; quick after the first one of a visit) ---------- */
#ld,#pt{position:fixed;inset:0;display:grid;place-items:center;align-content:center;gap:18px;text-align:center;background:radial-gradient(ellipse at 50% 38%,#fffdf7,#f4efe1 78%)}
#ld{z-index:2000;animation:ldauto 0s 7s forwards}
#pt{z-index:1999;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .22s ease,visibility 0s .22s}
#pt.on{opacity:1;visibility:visible;pointer-events:all;transition:opacity .22s ease}
html.ld-skip #ld,html:not(.js) #ld,html:not(.js) #pt{display:none}
@keyframes ldauto{to{visibility:hidden;pointer-events:none}}
html.ld-on{overflow:hidden}
@media(min-width:900px){.ld-logo{width:clamp(340px,30vw,520px)}.ld-bar{width:clamp(170px,14vw,240px);height:3px}.ld-tag{font-size:clamp(1.1rem,1.3vw,1.4rem)}#ld,#pt{gap:26px}}
.ld-logo{position:relative;width:clamp(190px,52vw,300px);aspect-ratio:406/94}
.ld-logo img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.ld-logo .g{opacity:.12;filter:grayscale(1)}
.ld-logo .c{clip-path:inset(0 100% 0 0);animation:ldfill 1.2s cubic-bezier(.6,0,.2,1) .1s forwards}
.ld-bar{width:clamp(104px,26vw,150px);height:2px;border-radius:2px;background:rgba(34,116,49,.14);overflow:hidden}
.ld-bar i{display:block;height:100%;background:#227431;transform:scaleX(0);transform-origin:0 50%;animation:ldbar 1.25s cubic-bezier(.6,0,.2,1) .1s forwards}
.ld-word{font:700 .74rem Manrope,sans-serif;letter-spacing:.42em;text-transform:uppercase;padding-left:.42em;color:#227431;opacity:0;animation:ldfade .6s .35s forwards}
.ld-tag{font:italic 600 .95rem 'Playfair Display',Georgia,serif;color:#6b6b55;opacity:0;animation:ldfade .6s .6s forwards}
html.ld-fast .ld-tag{display:none}
html.ld-fast #ld .c{animation-duration:.38s;animation-delay:0s}
html.ld-fast #ld .ld-bar i{animation-duration:.4s;animation-delay:0s}
html.ld-fast #ld .ld-word{animation-duration:.25s;animation-delay:0s}
#ld.wait .ld-logo{animation:ldpulse 1.2s ease-in-out infinite}
#ld.out{animation:ldout .5s ease forwards}
#ld.out .ld-logo{transform:scale(1.05);transition:transform .5s ease}
#pt .c{clip-path:inset(0 100% 0 0);animation:ldfill .5s cubic-bezier(.6,0,.2,1) .05s forwards}
#pt .ld-bar i{animation-duration:.5s;animation-delay:.05s}
@keyframes ldfill{to{clip-path:inset(0 0 0 0)}}
@keyframes ldbar{to{transform:scaleX(1)}}
@keyframes ldfade{to{opacity:1}}
@keyframes ldpulse{50%{transform:scale(1.04)}}
@keyframes ldout{to{opacity:0;visibility:hidden}}
/* while the loader is up, page reveals wait; they start as it lifts */
html.ld-on .hsp .wi{transform:translateY(118%)!important}
html.ld-on .rv{opacity:0!important;transform:translateY(28px)!important}

/* ---------- custom cursor: leaf; over links only it becomes the site favicon ---------- */
html.kc,html.kc *{cursor:none!important}
html.kc input:not([type=checkbox]):not([type=radio]):not([type=range]),html.kc textarea{cursor:text!important}
html.kc select,html.kc option{cursor:pointer!important}
#kd{position:fixed;left:0;top:0;z-index:2147483000;width:0;height:0;pointer-events:none;opacity:0;will-change:transform}
#kd.on{opacity:1}#kd.hide{opacity:0}
#kd i{position:absolute;left:-10px;top:-10px;width:20px;height:20px;display:block;transform-origin:50% 50%}
#kd svg{display:block;filter:drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgba(0,0,0,.25));transition:transform .15s,opacity .12s}
#kd.dn svg{transform:scale(.8)}
#kd .kf{position:absolute;left:-18px;top:-18px;width:36px;height:36px;box-sizing:border-box;padding:6px;object-fit:contain;border-radius:50%;background:#fff;border:1.5px solid #227431;box-shadow:0 3px 10px rgba(20,60,28,.3);opacity:0;transform:scale(.7);transition:opacity .12s,transform .15s}
#kd.lnk svg{opacity:0;transform:scale(0)}
#kd.lnk .kf{opacity:1;transform:none}
#kd.lnk.dn .kf{transform:scale(.9)}

/* ---------- headings: each line slides up from behind a mask ---------- */
.hsp .w{display:inline-block;overflow:hidden;vertical-align:top;padding:.1em .08em .18em;margin:-.1em -.08em -.18em}
.hsp .wi{display:inline-block;transform:translateY(118%);transition:transform 1.05s cubic-bezier(.16,.84,.24,1) calc(var(--l,0)*.13s + var(--b,0s));will-change:transform}
.hsp.in .wi,html.cine .scene.on .hsp .wi{transform:none}
.hero h1.hsp{--b:.1s}
.scene h2.hsp{--b:.12s}
@media(prefers-reduced-motion:reduce){.hsp .wi{transform:none!important;transition:none}}

/* ---------- drifting pollen / dust ---------- */
.fx-dust{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none;display:block}

/* ---------- hero depth: forest in front, mist behind; each moves at its own speed ---------- */
.depth{position:absolute;inset:0;overflow:hidden;background:#cfe0c8}
.hd-l{position:absolute;inset:0;will-change:transform;transform:scale(1.05)}
.hd-l img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:56% 56%;display:block}
.hd-back{transform-origin:50% 58%}
.hd-front{transform-origin:50% 78%}
.hd-mist{transform-origin:50% 55%}
.hd-mist i{position:absolute;left:0;width:200%;background:url(../images/site/hero-mist-layer.webp) repeat-x;background-size:50% 100%;animation:mistx 90s linear infinite}
.hd-mist.m1 i{top:4%;height:52%;opacity:.7}
.hd-mist.m2 i{top:34%;height:62%;opacity:.55;animation-duration:140s;animation-direction:reverse}
@keyframes mistx{to{transform:translateX(-50%)}}
html:not(.cine) .hd-front img{animation:kbf 26s ease-in-out infinite alternate}
html:not(.cine) .hd-back img{animation:kbb 26s ease-in-out infinite alternate}
@keyframes kbf{to{transform:scale(1.09)}}@keyframes kbb{to{transform:scale(1.04)}}
@media(max-width:700px){.hd-l img{object-position:62% 56%}.hd-mist.m1 i{height:42%}.hd-mist.m2 i{height:50%;top:42%}}
@media(prefers-reduced-motion:reduce){.hd-mist i{animation:none}}

/* pause ambient motion while the hero is off-screen */
.hero.off .hd-mist i{animation-play-state:paused}

/* pause the always-running site animations while they are off-screen (testimonials, marquee) */
.tsec.off .trk,.tsec.off .tc,.mq.off div{animation-play-state:paused}
.tc,.trk,.mq div{will-change:transform}
/* scroll cue: animate transform instead of top (no layout work) */
html.cine .scroll-cue i::after{top:0;transform:translateY(-100%);animation:cue2 1.8s cubic-bezier(.6,0,.3,1) infinite}
@keyframes cue2{to{transform:translateY(250%)}}

/* honeypot field for bots: invisible to people and screen readers */
.hp{position:absolute!important;left:-9999px!important;width:1px;height:1px;opacity:0;pointer-events:none}
