/* AM Hernandez Realty — motion layer. Only active when animations.js adds .anim to <html>. */

/* ---------- Scroll progress + header ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 400; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, var(--blue), var(--brown)); pointer-events: none; }
.header { transition: box-shadow .3s ease, background-color .3s ease; }
.header.is-stuck { box-shadow: 0 6px 24px rgba(18,20,23,.10); }
.logo__mark { transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.logo:hover .logo__mark { transform: rotate(360deg) scale(1.06); }

/* ---------- Scroll reveal ---------- */
.anim [data-anim] { opacity: 0; transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); will-change: opacity, transform; }
.anim [data-anim="up"]    { transform: translateY(36px); }
.anim [data-anim="left"]  { transform: translateX(-44px); }
.anim [data-anim="right"] { transform: translateX(44px); }
.anim [data-anim="zoom"]  { transform: scale(.92); }
.anim [data-anim].is-in { opacity: 1; transform: none; }

/* ---------- Hero entrance ---------- */
@keyframes amh-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes amh-pop  { from { opacity: 0; transform: translateX(40px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes amh-drift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes amh-kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }
@keyframes amh-shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes amh-pulse { 0% { box-shadow: 0 0 0 0 rgba(25,118,210,.45); } 70% { box-shadow: 0 0 0 14px rgba(25,118,210,0); } 100% { box-shadow: 0 0 0 0 rgba(25,118,210,0); } }

.anim .hero__grid > div:first-child > * { opacity: 0; animation: amh-rise .9s cubic-bezier(.2,.7,.2,1) forwards; }
.anim .hero__grid > div:first-child > *:nth-child(1) { animation-delay: .05s; }
.anim .hero__grid > div:first-child > *:nth-child(2) { animation-delay: .18s; }
.anim .hero__grid > div:first-child > *:nth-child(3) { animation-delay: .32s; }
.anim .hero__grid > div:first-child > *:nth-child(4) { animation-delay: .46s; }
.anim .hero__grid > div:first-child > *:nth-child(5) { animation-delay: .60s; }
.anim .hero__media { opacity: 0; animation: amh-pop 1.1s .25s cubic-bezier(.2,.7,.2,1) forwards; box-shadow: 0 24px 60px rgba(18,20,23,.16); }

.anim .hero__trust li { opacity: 0; animation: amh-rise .6s ease forwards; }
.anim .hero__trust li:nth-child(1) { animation-delay: .75s; } .anim .hero__trust li:nth-child(2) { animation-delay: .87s; }
.anim .hero__trust li:nth-child(3) { animation-delay: .99s; } .anim .hero__trust li:nth-child(4) { animation-delay: 1.11s; }
.anim .search-card { opacity: 0; animation: amh-rise .9s .55s cubic-bezier(.2,.7,.2,1) forwards; }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .25s ease, background-color .2s ease, border-color .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(18,20,23,.16); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.btn--primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-120%) skewX(-20deg); pointer-events: none; }
.btn--primary:hover::after { animation: amh-shine .8s ease; }


/* ---------- Cards ---------- */
.prop-card, .service, .loc-card, .post-card, .quote, .step, .stat { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease, border-color .3s ease; }
.prop-card:hover, .service:hover, .loc-card:hover, .post-card:hover, .quote:hover { transform: translateY(-8px); box-shadow: 0 22px 44px rgba(18,20,23,.14); border-color: rgba(25,118,210,.35); }
.step:hover { transform: translateY(-6px); border-color: var(--blue-light); }
/* No image zoom on hover: photos are always shown whole, never cropped */
.service__icon { transition: transform .4s cubic-bezier(.3,1.6,.5,1), background-color .3s, color .3s; }
.service:hover .service__icon { transform: rotate(-8deg) scale(1.15); background: var(--blue); color: #fff; }
.stat:hover strong { transform: scale(1.08); }
.stat strong { display: block; width: fit-content; margin-bottom: 4px; transform-origin: left center; transition: transform .3s ease; }
.chip-group label { transition: transform .15s ease, border-color .15s, background .15s; }
.chip-group label:active { transform: scale(.96); }

/* ---------- Modal ---------- */
@keyframes amh-modal-in { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes amh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes amh-step { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes amh-modal-spring { 0% { opacity: 0; transform: translateY(60px) scale(.9) rotateX(8deg); } 60% { opacity: 1; transform: translateY(-6px) scale(1.015) rotateX(0); } 100% { opacity: 1; transform: none; } }
@keyframes amh-backdrop { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(5px); } }
@keyframes amh-item { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes amh-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes amh-close-spin { from { opacity: 0; transform: rotate(-180deg) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes amh-glow { 0% { box-shadow: 0 0 0 0 rgba(25,118,210,.5); } 100% { box-shadow: 0 0 0 18px rgba(25,118,210,0); } }

.modal__backdrop { -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.modal.is-open .modal__backdrop { animation: amh-backdrop .4s ease both; }
.modal.is-open .modal__dialog { animation: amh-modal-spring .65s cubic-bezier(.22,1,.36,1) both; transform-origin: 50% 100%; perspective: 800px; }
.modal.is-open .modal__dialog::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: linear-gradient(90deg, var(--blue), var(--brown), var(--blue)); background-size: 200% 100%; animation: amh-drift 3s linear infinite; }
.modal.is-open .modal__close { animation: amh-close-spin .6s .3s cubic-bezier(.2,.8,.2,1) backwards; }
.modal.is-open .modal__dialog > .eyebrow, .modal.is-open .modal__dialog > h2, .modal.is-open .modal__dialog > p,
.modal.is-open .modal__dialog .progress { animation: amh-item .55s cubic-bezier(.2,.8,.2,1) both; }
.modal.is-open .modal__dialog > .eyebrow { animation-delay: .20s; }
.modal.is-open .modal__dialog > h2 { animation-delay: .27s; }
.modal.is-open .modal__dialog > p { animation-delay: .34s; }
.modal.is-open .modal__dialog .progress { animation-delay: .41s; }
.modal.is-open .progress__bar { transform-origin: 0 50%; animation: amh-bar .8s .5s cubic-bezier(.2,.8,.2,1) both; }
.modal.is-open .form-step.is-active > .eyebrow, .modal.is-open .form-step.is-active > h3 { animation: amh-item .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: .5s; }
.modal.is-open .form-step.is-active .chip-group > span { animation: amh-item .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.55s + var(--i, 0) * 55ms); }
.modal.is-open .form-step.is-active .form-step__actions { animation: amh-item .5s .95s cubic-bezier(.2,.8,.2,1) both; }
.modal .chip-group input:checked + label { animation: amh-glow .6s ease-out; }
.modal .chip-group > span:nth-child(1) { --i: 0; } .modal .chip-group > span:nth-child(2) { --i: 1; } .modal .chip-group > span:nth-child(3) { --i: 2; }
.modal .chip-group > span:nth-child(4) { --i: 3; } .modal .chip-group > span:nth-child(5) { --i: 4; } .modal .chip-group > span:nth-child(6) { --i: 5; }
.form-step.is-active { animation: amh-step .4s cubic-bezier(.2,.8,.2,1); }
.progress__bar { transition: width .5s cubic-bezier(.2,.8,.2,1); }
.modal__close { transition: transform .25s ease; }
.modal__close:hover { transform: rotate(90deg); }

/* ---------- Floating chat / mobile bar ---------- */
@keyframes amh-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (prefers-reduced-motion: reduce) {
  .modal *, .modal *::before { animation: none !important; }
  .anim [data-anim] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .anim .hero, .anim .hero__media img,
  .anim .hero__grid > div:first-child > *, .anim .hero__media, .anim .hero__trust li, .anim .search-card { opacity: 1 !important; animation: none !important; }
  .scroll-progress { display: none; }
}
