/* HomeConnect: shared motion layer, loaded by every page after its own styles.
   The brief is calm, slow-camera motion. Everything here is an enhancement: with reduced
   motion, or in a browser that lacks a feature, the page simply shows its final state. */

:root{--hc-ease:cubic-bezier(.16,1,.3,1);}

/* 1. Page to page: a soft crossfade instead of a white flash (cross-document view transitions).
      The nav and the WhatsApp button hold their place while the page changes underneath. */
@view-transition{navigation:auto;}
::view-transition-old(root),::view-transition-new(root){animation-duration:.42s;animation-timing-function:cubic-bezier(.4,0,.2,1);}
#hc-nav{view-transition-name:hc-nav;}
#hc-wa-fab{view-transition-name:hc-fab;}
::view-transition-group(hc-nav),::view-transition-group(hc-fab){animation-duration:.3s;}
/* The nav slides in on the first page of a visit only, so it never blinks between pages. */
html.hc-seen #hc-nav{animation:none;}

/* 2. Hero headline: the words settle one after another. */
.hc-hin.hc-words{opacity:1;transform:none;filter:none;animation:none;}
.hc-wd{display:inline-block;opacity:0;transform:translateY(.4em);filter:blur(10px);animation:hcWd 1.15s var(--hc-ease) both;animation-delay:calc(.28s + var(--w,0) * .11s);}
@keyframes hcWd{to{opacity:1;transform:none;filter:blur(0);}}

/* 3. Photo bands: a slow pull-back as the photo scrolls in, tied to the scroll position. */
@supports (animation-timeline: view()){
  @media (prefers-reduced-motion: no-preference){
    .hc-band > img{animation:hcBandCam linear both;animation-timeline:view();animation-range:entry 0% cover 60%;}
    @keyframes hcBandCam{from{scale:1.16;}to{scale:1;}}
  }
}

/* 4. Expanding answers (FAQ, "See the numbers") open and close smoothly. */
@supports (interpolate-size: allow-keywords){
  @media (prefers-reduced-motion: no-preference){
    :root{interpolate-size:allow-keywords;}
    details::details-content{block-size:0;overflow-y:clip;transition:block-size .45s var(--hc-ease),content-visibility .45s allow-discrete;}
    details[open]::details-content{block-size:auto;}
  }
}

/* 5. Buttons: the arrow leans the way it points. */
.hc-cta svg,.hc-btn svg,#hc-submit svg{transition:transform .35s var(--hc-ease);}
.hc-cta:hover .lucide-arrow-right,.hc-btn:hover .lucide-arrow-right,#hc-submit:hover .lucide-arrow-right{transform:translateX(4px);}
.hc-cta:hover .lucide-arrow-down,.hc-btn:hover .lucide-arrow-down{transform:translateY(3px);}

/* 6. WhatsApp button: a short label says what it does (shown once per visit, and on hover). */
.hc-fab-label{position:absolute;right:calc(100% + 12px);top:50%;transform:translate(10px,-50%);opacity:0;white-space:nowrap;background:#fff;color:#1A2B4A;font:600 13.5px/1 Inter,sans-serif;padding:11px 15px;border-radius:999px;box-shadow:0 10px 28px rgba(21,36,64,.22);pointer-events:none;transition:opacity .35s ease,transform .5s var(--hc-ease);}
#hc-wa-fab:hover .hc-fab-label,#hc-wa-fab:focus-visible .hc-fab-label,#hc-wa-fab.hc-fab-on .hc-fab-label{opacity:1;transform:translate(0,-50%);}

/* 7. Phone menu: the links arrive in sequence each time it opens. */
#hc-menu > *{animation:hcMi .5s var(--hc-ease) both;}
#hc-menu > :nth-child(2){animation-delay:.03s;}
#hc-menu > :nth-child(3){animation-delay:.06s;}
#hc-menu > :nth-child(4){animation-delay:.09s;}
#hc-menu > :nth-child(5){animation-delay:.12s;}
#hc-menu > :nth-child(6){animation-delay:.15s;}
#hc-menu > :nth-child(7){animation-delay:.18s;}
#hc-menu > :nth-child(n+8){animation-delay:.21s;}
@keyframes hcMi{from{opacity:0;transform:translateY(-6px);}}

/* 8. Enquiry sent: the tick draws itself. */
#hc-success > div:first-child,.hc-success-ico{animation:hcPop .6s var(--hc-ease) both;}
#hc-success > div:first-child svg path,.hc-success-ico svg path{stroke-dasharray:26;stroke-dashoffset:26;animation:hcDraw .5s .3s ease-out forwards;}
@keyframes hcPop{from{transform:scale(.6);opacity:0;}}
@keyframes hcDraw{to{stroke-dashoffset:0;}}

@media (prefers-reduced-motion: reduce){
  @view-transition{navigation:none;}
  .hc-wd{animation:none;opacity:1;transform:none;filter:none;}
  #hc-menu > *,#hc-success > div:first-child,.hc-success-ico{animation:none;}
  #hc-success > div:first-child svg path,.hc-success-ico svg path{animation:none;stroke-dashoffset:0;}
  .hc-fab-label,.hc-cta svg,.hc-btn svg,#hc-submit svg{transition:none;}
}
