/* =====================================================================
   SITE ANIMATIONS PLUS  (pairs with site-animations-v2.js)
   Load AFTER site-animations.css:
   style.css -> theme-override.css -> site-animations.css -> site-animations-plus.css
   ===================================================================== */

/* ---------- 1. Headings rise word by word ---------- */
.js-anim .split .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: .14em;      /* keeps descenders (g, y, p) from being clipped */
  margin-bottom: -.14em;
}
.js-anim .split .wi {
  display: inline-block;
  transform: translateY(115%) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform .9s var(--ease-out, cubic-bezier(.22, 1, .36, 1));
  transition-delay: var(--wd, 0s);
  will-change: transform;
}
.js-anim .split.in-view .wi { transform: none; }

/* ---------- 2. Smart header: slides away on scroll down, returns on scroll up ---------- */
.site-header { transition: transform .4s var(--ease-out, ease), box-shadow .4s; }
.site-header.is-hidden { transform: translateY(-110%); box-shadow: none; }

/* ---------- 3. Back-to-top: progress ring around the button ---------- */
#to-top {
  position: fixed;
  background: conic-gradient(var(--accent, #f5a524) calc(var(--p, 0) * 1%), rgba(255, 255, 255, .18) 0) !important;
  color: var(--text, #fff) !important;
}
#to-top::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--ink-900, #0b1820);
  transition: background .3s;
}
#to-top span { position: relative; display: block; line-height: 1; transition: transform .3s var(--ease-spring, ease); }
#to-top:hover::before { background: var(--accent, #f5a524); }
#to-top:hover { color: var(--on-accent, #0b1820) !important; }
#to-top:hover span { transform: translateY(-3px); }

/* ---------- 4. Cards: 3D tilt + moving glare (driven by JS variables) ---------- */
[data-tilt] { position: relative; }
[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle 240px at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 70%);
  transition: opacity .35s;
  z-index: 3;
}
[data-tilt].tilting::after { opacity: 1; }
[data-tilt].tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px) !important;
  transition: transform .12s linear, box-shadow .3s !important;
  box-shadow: 0 22px 44px rgba(0, 0, 0, .5), 0 0 0 1px rgba(245, 165, 36, .35);
}

/* ---------- 5. Magnetic buttons use the independent "translate" property ---------- */
.theme_btn, .theme_btn1 {
  transition: transform .3s var(--ease-out, ease), translate .35s var(--ease-out, ease), box-shadow .3s, color .3s;
}

/* ---------- 6. Parallax images: slightly enlarged so edges never show ---------- */
.px { scale: 1.14; will-change: translate; }
.writrz_img { overflow: hidden; }

/* ---------- 7. Images fade in as they load ---------- */
.js-anim img.img-fade { opacity: 0; transition: opacity .8s ease, transform .6s var(--ease-out, ease), filter .6s; }
.js-anim img.img-fade.img-loaded { opacity: 1; }

/* ---------- 8. Page transition ---------- */
html.page-leaving body { opacity: 0; transition: opacity .25s ease; }

/* ---------- 9. Hero content: smooth when the JS parallax moves it ---------- */
.banner_main .banner_txt, .banner_main .banner_form_wrp { will-change: translate; }

/* ---------- Print: show everything ---------- */
@media print {
  .js-anim .reveal, .js-anim .split .wi, .js-anim img.img-fade {
    opacity: 1 !important; transform: none !important; filter: none !important;
  }
  #scroll-progress, #to-top { display: none !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .split .wi { transform: none !important; transition: none !important; }
  .site-header.is-hidden { transform: none; }
  [data-tilt].tilting { transform: none !important; }
  .px { scale: 1; }
  html.page-leaving body { opacity: 1; }
}