/* HIGHWINGS premium motion layer. Transform/opacity only (smooth on phones).
   Everything is skipped for visitors who ask their device to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  :root { --hw-out: cubic-bezier(.2,.7,.2,1); }

  /* 1. Mobile menu: slides down, links stagger in, burger turns */
  .hamb { transition: transform .35s var(--hw-out), background-color .25s ease, border-color .25s ease; }
  .hamb[aria-expanded="true"] { transform: rotate(90deg); }
  @media (max-width: 900px) {
    header .links.open { animation: hwMenuIn .34s var(--hw-out) both; }
    header .links.open > * { animation: hwMenuLink .45s var(--hw-out) both; }
    header .links.open > *:nth-child(1) { animation-delay: .05s; }
    header .links.open > *:nth-child(2) { animation-delay: .09s; }
    header .links.open > *:nth-child(3) { animation-delay: .13s; }
    header .links.open > *:nth-child(4) { animation-delay: .17s; }
    header .links.open > *:nth-child(5) { animation-delay: .21s; }
    header .links.open > *:nth-child(6) { animation-delay: .25s; }
    header .links.open > *:nth-child(n+7) { animation-delay: .29s; }
  }
  @keyframes hwMenuIn   { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
  @keyframes hwMenuLink { from { opacity: 0; transform: translateY(10px); }  to { opacity: 1; transform: none; } }

  /* 2. Gold light-sweep across primary buttons */
  body .btn-primary, body .advisory-btn-primary, body .buy-btn-primary, body .btn-gold, body .btn-navy { position: relative; overflow: hidden; isolation: isolate; }
  body .btn-primary::before, body .advisory-btn-primary::before, body .buy-btn-primary::before, body .btn-gold::before, body .btn-navy::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.30) 50%, transparent 70%);
    transform: translateX(-130%); transition: transform .8s var(--hw-out);
  }
  @media (hover: hover) {
    body .btn-primary:hover::before, body .advisory-btn-primary:hover::before, body .buy-btn-primary:hover::before, body .btn-gold:hover::before, body .btn-navy:hover::before { transform: translateX(130%); }
  }

  /* 3. Touch feedback: buttons press in slightly */
  @media (hover: none) {
    body .btn, body .buy-btn, body .advisory-btn, body .btn-gold, body .btn-navy, body .btn-ghost, body .hw-enquire, body .card-btn {
      transition: transform .18s var(--hw-out), box-shadow .18s ease;
    }
    body .btn:active, body .buy-btn:active, body .advisory-btn:active, body .btn-gold:active, body .btn-navy:active, body .btn-ghost:active,
    body .hw-enquire:active, body .card-btn:active { transform: scale(.965); }
  }

  /* 4. Property cards: photo glides in/zooms softly, cards rise in one by one */
  .hw-property-photo { transition: transform 1s var(--hw-out); will-change: transform; }
  @media (hover: hover) {
    .hw-property-card:hover .hw-property-photo { transform: scale(1.06); }
  }
  .hw-property-grid .hw-property-card { animation: hwCardIn .75s var(--hw-out) both; }
  .hw-property-grid .hw-property-card:nth-child(2) { animation-delay: .08s; }
  .hw-property-grid .hw-property-card:nth-child(3) { animation-delay: .16s; }
  .hw-property-grid .hw-property-card:nth-child(4) { animation-delay: .24s; }
  .hw-property-grid .hw-property-card:nth-child(5) { animation-delay: .32s; }
  .hw-property-grid .hw-property-card:nth-child(n+6) { animation-delay: .4s; }
  @keyframes hwCardIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

  /* 5. Property page photos */
  .hero-photo img, .side-photo img { transition: transform 1s var(--hw-out); }
  @media (hover: hover) {
    .hero-photo:hover img, .side-photo:hover img { transform: scale(1.05); }
  }
  .advisor { animation: hwSlideIn .8s var(--hw-out) .15s both; }
  @keyframes hwSlideIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

  /* 6. Images fade in once loaded (class added by premium-motion.js) */
  img.hw-fade { opacity: 0; transition: opacity .7s ease; }
  img.hw-fade.hw-loaded { opacity: 1; }

  /* 7. Footer links slide on hover, form fields glow in gold */
  .site-footer .footer-col a { transition: color .25s ease, transform .3s var(--hw-out); }
  @media (hover: hover) {
    .site-footer .footer-col a:hover { transform: translateX(5px); }
  }
  input, select, textarea { transition: border-color .25s ease, box-shadow .3s ease, background-color .25s ease; }
  input:focus, select:focus, textarea:focus { border-color: #c9a64d !important; box-shadow: 0 0 0 3px rgba(201,166,77,.22) !important; }
  /* 8. Page-to-page transitions (cross-document View Transitions).
        Chrome/Edge/Safari 18.2+: header stays put, page content fades and rises in.
        Other browsers ignore this and use the fade fallback in premium-motion.js. */
  @view-transition { navigation: auto; }
  header { view-transition-name: hw-site-header; }
  ::view-transition-group(hw-site-header) { animation-duration: 0s; }
  ::view-transition-old(root) { animation: hwVtOut .22s ease both; }
  ::view-transition-new(root) { animation: hwVtIn .42s var(--hw-out) both; }
  @keyframes hwVtOut { to { opacity: 0; } }
  @keyframes hwVtIn  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  /* Fallback fade-out used by premium-motion.js when View Transitions are unavailable */
  html.hw-leaving { opacity: 0; transition: opacity .2s ease; }
}
