/* =====================================================================
   4S MedTech — V126 homepage motion
   Every element ends exactly where the V124 design puts it; this file only
   controls how things arrive and how they respond to the cursor.
   Gated by html.hm-ready (added in <head> only when motion is allowed).
   ===================================================================== */

:root{--hm-ease:cubic-bezier(.16,.84,.24,1);--hm-spring:cubic-bezier(.34,1.4,.5,1)}

/* ---------- Shared transition for everything that animates in ---------- */
html.hm-ready :is(
  .v22-eyebrow,.v93-eyebrow,.v22-title-copy > p,.v43-about-copy > p,.v93-copy > p,
  .v22-section-title > a,.v6-disclaimer,.v47-about-button,.v93-button,.v95-action,
  .v6-speciality,.v6-product,.v57-card,.v95-card,.v47-principles-row li,.v93-card,
  .v49-mobile-visual,.v93-visual,.v97-form-panel,.v97-info,.v97-field,.v99-consent-line,.v97-form-foot,.v97-contact-item):not(.hm-done){
  transition:opacity .9s var(--hm-ease),transform 1.1s var(--hm-ease),clip-path 1.2s var(--hm-ease),filter .9s var(--hm-ease);
  transition-delay:var(--hm-d,0ms);
}
/* .hm-done (set after arrival) hands transitions back to the original hover styles */

/* ---------- Starting states (only while not yet .hm-on) ---------- */
/* Eyebrows: fade, then their side lines draw outwards */
html.hm-ready :is(.v22-eyebrow,.v93-eyebrow):not(.hm-on){opacity:0;transform:translateY(12px)}
html.hm-ready :is(.v22-eyebrow,.v93-eyebrow)::before,
html.hm-ready :is(.v22-eyebrow,.v93-eyebrow)::after{transition:transform .9s var(--hm-ease) calc(var(--hm-d,0ms) + 250ms)}
html.hm-ready :is(.v22-eyebrow,.v93-eyebrow):not(.hm-on)::before{transform:scaleX(0);transform-origin:100% 50%}
html.hm-ready :is(.v22-eyebrow,.v93-eyebrow):not(.hm-on)::after{transform:scaleX(0);transform-origin:0 50%}


/* Body copy and single buttons fade up */
html.hm-ready :is(.v22-title-copy > p,.v43-about-copy > p,.v93-copy > p,.v6-disclaimer,.v95-action,.v47-about-button,.v93-button):not(.hm-on){opacity:0;transform:translateY(24px)}
html.hm-ready .v22-section-title > a:not(.hm-on){opacity:0;transform:translateX(26px)}

/* Card grids: rise, scale and come into focus, one after another */
html.hm-ready :is(.v6-speciality,.v6-product,.v95-card):not(.hm-on){opacity:0;transform:translateY(40px)}
html.hm-ready .v57-card:not(.hm-on){opacity:0;transform:perspective(900px) translateY(40px) rotateX(14deg);transform-origin:50% 100%}
/* About principles pop in */
html.hm-ready .v47-principles-row li:not(.hm-on){opacity:0;transform:translateY(16px)}
html.hm-ready .v47-principles-row li.hm-on{transition-timing-function:var(--hm-ease),var(--hm-spring)}
/* Partnership cards slide in from the right */
html.hm-ready .v93-card:not(.hm-on){opacity:0;transform:translateX(46px)}

/* Section photos wipe open */
html.hm-ready .v47-about::before{transition:clip-path 1.6s var(--hm-ease) .15s,transform 2.2s var(--hm-ease) .15s}
html.hm-ready .v47-about:not(.hm-on)::before{clip-path:inset(0 0 0 100%)}
html.hm-ready .v47-about.hm-on::before{clip-path:inset(0)}
html.hm-ready .v49-mobile-visual:not(.hm-on){clip-path:inset(0 0 0 100%)}
html.hm-ready .v49-mobile-visual.hm-on{clip-path:inset(0)}
html.hm-ready .v93-visual{transition:clip-path 1.6s var(--hm-ease),transform 2.2s var(--hm-ease)!important}
html.hm-ready .v93-visual:not(.hm-on){clip-path:inset(0 100% 0 0)}
html.hm-ready .v93-visual.hm-on{clip-path:inset(0)}

/* Contact: panels slide together, fields cascade */
html.hm-ready .v97-form-panel:not(.hm-on){opacity:0;transform:translateX(-40px)}
html.hm-ready .v97-info:not(.hm-on){opacity:0;transform:translateX(40px)}
html.hm-ready :is(.v97-field,.v99-consent-line,.v97-form-foot):not(.hm-on){opacity:0;transform:translateY(18px)}
html.hm-ready .v97-contact-item:not(.hm-on){opacity:0;transform:translateX(24px)}

/* ---------- Line icons draw themselves ---------- */
.hm-draw :is(path,circle,rect,line,polyline,polygon,ellipse){stroke-dasharray:1;stroke-dashoffset:1}
.hm-draw.hm-drawn :is(path,circle,rect,line,polyline,polygon,ellipse){animation:hm-draw 1.1s var(--hm-ease) forwards;animation-delay:var(--hm-sd,0ms)}
@keyframes hm-draw{to{stroke-dashoffset:0}}

/* ---------- Accent words get a single light sweep ---------- */
.hm-shine{-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  background-size:300% 100%;background-repeat:no-repeat;animation:hm-shine 1.5s var(--hm-ease) forwards;animation-delay:var(--hm-sd,0ms)}
@keyframes hm-shine{from{background-position:100% 0}to{background-position:0 0}}

/* ---------- Hero: cursor light ---------- */
.hm-spot{position:absolute;inset:0;z-index:0;pointer-events:none;opacity:0;transition:opacity .6s var(--hm-ease);
  background:radial-gradient(520px circle at var(--hm-x,60%) var(--hm-y,40%),rgba(110,210,245,.16),rgba(110,210,245,0) 60%);
  mix-blend-mode:screen}
:is(.v6-hero,.v47-about,.v93-partner):hover > .hm-spot{opacity:1}

/* ---------- Card tilt (desktop) ---------- */
.hm-tilt{transform-style:preserve-3d;will-change:transform}
.hm-tilting{transition:transform .14s linear,box-shadow .4s var(--hm-ease)!important}
.hm-tilt .hm-shade{position:absolute;inset:0;z-index:4;pointer-events:none;border-radius:inherit;opacity:0;transition:opacity .4s;
  background:linear-gradient(var(--hm-a,135deg),rgba(255,255,255,.28),rgba(255,255,255,0) 55%)}
.hm-tilting .hm-shade{opacity:1}

/* ---------- Magnetic buttons ---------- */
.hm-mag{transition:transform .5s var(--hm-spring),box-shadow .3s,background-color .3s,color .3s,border-color .3s!important}
.hm-mag.hm-pull{transition:transform .18s linear,box-shadow .3s!important}

/* ---------- Small hover extras ---------- */
body.v6-home .v57-card:hover .v57-icon{animation:hm-bob .7s var(--hm-spring)}
body.v6-home .v93-card:hover .v93-icon{animation:hm-bob .7s var(--hm-spring)}
@keyframes hm-bob{0%{transform:translateY(0)}40%{transform:translateY(-5px) rotate(-6deg)}100%{transform:none}}
body.v6-home .v95-read span{display:inline-block;transition:transform .35s var(--hm-ease)}
body.v6-home .v95-card:hover .v95-read span{transform:translateX(5px)}
body.v6-home .v47-principles-row li{transition:transform .4s var(--hm-spring)}
body.v6-home .v47-principles-row li:hover{transform:translateY(-4px)}
body.v6-home .v47-principles-row li:hover .v44-principle-icon{animation:hm-bob .7s var(--hm-spring)}

/* Phones: lighter motion, no blur */
@media (max-width:760px){
  html.hm-ready :is(.v6-speciality,.v6-product,.v95-card):not(.hm-on){filter:none;transform:translateY(34px)}
  html.hm-ready .v57-card:not(.hm-on){transform:translateY(30px)}
}
@media (prefers-reduced-motion:reduce){.hm-draw :is(path,circle,rect,line,polyline,polygon,ellipse){stroke-dasharray:none;stroke-dashoffset:0}.hm-shine{animation:none;-webkit-text-fill-color:currentColor;background:none}}
