/*
 * ZRE Website: motion (new in 2.1)
 * Loaded only when Settings → ZRE Website → Animations = On.
 * Everything is scoped under html.zre-motion (added in <head>) so nothing is hidden
 * if this file or the script doesn't load. Anyone with "reduce motion" turned on
 * gets the still version (see the media query at the bottom).
 */

/* ---------- Shared: calm fade-up as sections come into view ---------- */
html.zre-motion .zre-hp .zre-rv { opacity: 0; transform: translateY(32px); transition: opacity .85s cubic-bezier(.2, .7, .2, 1), transform .85s cubic-bezier(.2, .7, .2, 1); }
html.zre-motion .zre-hp .zre-rv.is-in { opacity: 1; transform: none; }
html.zre-motion .zre-hp .zre-rv[data-zre-d="1"] { transition-delay: .08s; }
html.zre-motion .zre-hp .zre-rv[data-zre-d="2"] { transition-delay: .16s; }
html.zre-motion .zre-hp .zre-rv[data-zre-d="3"] { transition-delay: .24s; }
/* Listing pages move less, so they feel calm while people read */
html.zre-motion .zre-l .zre-rv { transform: translateY(20px); transition-duration: .7s; }

/* ---------- Shared: big headings rise line by line ---------- */
html.zre-motion .zre-hp .zre-line { display: block; overflow: hidden; padding-bottom: .1em; margin-bottom: -.1em; }
html.zre-motion .zre-hp .zre-line > span { display: block; transform: translateY(110%); transition: transform 1.1s cubic-bezier(.16, .84, .24, 1); }
html.zre-motion .zre-hp .zre-line + .zre-line > span { transition-delay: .12s; }
html.zre-motion .zre-hp .is-in .zre-line > span,
html.zre-motion .zre-hp .is-in.zre-lines .zre-line > span { transform: none; }
/* Hero title: hidden until it's split into lines (falls back to visible after 2.5s) */
html.zre-motion .zre-hp .zre-hero__title:not(.zre-lines) { opacity: 0; animation: zreShow 0s 2.5s forwards; }
@keyframes zreShow { to { opacity: 1; } }

/* ---------- Shared: header tucks away on scroll down, back on scroll up ---------- */
html.zre-motion .zre-hp .zre-hdr { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
html.zre-motion.zre-tuck .zre-hp .zre-hdr { transform: translateY(calc(-100% - 2px)); }
html.zre-motion .zre-hp .zre-hdr__progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--zre-sp, 0)); background: linear-gradient(90deg, #f0c674, #e2b04a); pointer-events: none; }

/* ---------- Shared: Ask ZAI button shimmer ---------- */
html.zre-motion .zre-hp .zre-hdr__zai { position: relative; overflow: hidden; border-color: #e8d3a0; box-shadow: 0 0 0 3px rgba(240, 198, 116, .14); }
html.zre-motion .zre-hp .zre-hdr__zai::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; background: linear-gradient(100deg, transparent, rgba(240, 198, 116, .55), rgba(255, 255, 255, .9), rgba(240, 198, 116, .55), transparent); transform: skewX(-20deg); animation: zreShine 4.5s ease-in-out 1.2s infinite; pointer-events: none; }
@keyframes zreShine { 0% { left: -60%; } 28% { left: 130%; } 100% { left: 130%; } }

/* ---------- Shared: clean rounded hover lift on cards ---------- */
html.zre-motion .zre-hp .zre-browse__item,
html.zre-motion .zre-hp .zre-card { border-radius: 26px; margin: -10px; padding: 10px 10px 18px; background: rgba(255, 255, 255, 0); }
html.zre-motion .zre-hp .zre-browse__item .zre-eyebrow,
html.zre-motion .zre-hp .zre-browse__label,
html.zre-motion .zre-hp .zre-card__suburb,
html.zre-motion .zre-hp .zre-card__price,
html.zre-motion .zre-hp .zre-card__meta { padding-left: 6px; padding-right: 6px; }
html.zre-motion .zre-hp .zre-browse__item,
html.zre-motion .zre-hp .zre-card,
html.zre-motion .zre-hp .zre-tile,
html.zre-motion .zre-hp .zre-insight { transition: opacity .85s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease, background-color .4s ease; }
html.zre-motion .zre-hp .zre-browse__item.is-in:hover,
html.zre-motion .zre-hp .zre-card.is-in:hover { background: #fff; }
html.zre-motion .zre-hp .zre-browse__item.is-in:hover,
html.zre-motion .zre-hp .zre-card.is-in:hover,
html.zre-motion .zre-hp .zre-tile.is-in:hover,
html.zre-motion .zre-hp .zre-insight.is-in:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(10, 31, 54, .04), 0 24px 48px -16px rgba(10, 31, 54, .2); }
html.zre-motion .zre-hp .zre-browse__item img,
html.zre-motion .zre-hp .zre-card__media img,
html.zre-motion .zre-hp .zre-tile__img { transition: transform 1s cubic-bezier(.2, .7, .2, 1); }
html.zre-motion .zre-hp .zre-browse__item:hover img,
html.zre-motion .zre-hp .zre-tile:hover .zre-tile__img { transform: scale(1.025); }

/* ---------- Shared: buttons feel pressable ---------- */
html.zre-motion .zre-hp .zre-btn,
html.zre-motion .zre-hp .zre-pill,
html.zre-motion .zre-hp .zre-topic,
html.zre-motion .zre-hp .zre-mbar__btn { transition: scale .18s ease, background-color .25s ease, border-color .25s ease, color .25s ease, translate .5s cubic-bezier(.2, .7, .2, 1); }
html.zre-motion .zre-hp .zre-btn:active,
html.zre-motion .zre-hp .zre-pill:active,
html.zre-motion .zre-hp .zre-topic:active,
html.zre-motion .zre-hp .zre-mbar__btn:active { scale: .97; }

/* ---------- Homepage: video hero ---------- */
html.zre-motion .zre-hp .zre-hero--video { clip-path: inset(0 calc(var(--zre-hp, 0) * 24px) calc(var(--zre-hp, 0) * 20px) round 0 0 calc(var(--zre-hp, 0) * 36px) calc(var(--zre-hp, 0) * 36px)); }
html.zre-motion .zre-hp .zre-hero__video { transform: scale(calc(1.12 - var(--zre-hp, 0) * .12)) translateY(calc(var(--zre-hp, 0) * 40px)); transition: filter .6s ease; will-change: transform; }
html.zre-motion .zre-hp .zre-hero__in { transform: translateY(calc(var(--zre-hp, 0) * -60px)); opacity: calc(1 - var(--zre-hp, 0) * .55); }
html.zre-motion .zre-hp .zre-hero__in > .zre-kicker,
html.zre-motion .zre-hp .zre-hero__sub,
html.zre-motion .zre-hp .zre-hero__search,
html.zre-motion .zre-hp .zre-hero__zai { animation: zreUp 1s cubic-bezier(.2, .7, .2, 1) both; }
html.zre-motion .zre-hp .zre-hero__sub { animation-delay: .18s; }
html.zre-motion .zre-hp .zre-hero__search { animation-delay: .3s; }
html.zre-motion .zre-hp .zre-hero__zai { animation-delay: .4s; }
html.zre-motion .zre-hp .zre-hero .zre-line > span { transform: none; transition: none; animation: zreLine 1.15s cubic-bezier(.16, .84, .24, 1) .1s both; }
html.zre-motion .zre-hp .zre-hero .zre-line + .zre-line > span { animation-delay: .24s; }
@keyframes zreUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes zreLine { from { transform: translateY(110%); } to { transform: none; } }
/* Click into the search: the video blurs and the search comes forward */
html.zre-motion .zre-hp .zre-hero:focus-within .zre-hero__video { filter: blur(8px) brightness(.55) saturate(.8); }
html.zre-motion .zre-hp .zre-hero:focus-within .zre-hero__title,
html.zre-motion .zre-hp .zre-hero:focus-within .zre-hero__sub { opacity: .55; transition: opacity .5s; }
html.zre-motion .zre-hp .zre-hero__search { transition: scale .5s cubic-bezier(.2, .7, .2, 1); }
html.zre-motion .zre-hp .zre-hero__search:focus-within { scale: 1.015; }

/* ---------- Homepage: feature tiles grow in, photo rises ---------- */
html.zre-motion .zre-hp .zre-feature { transform: scale(calc(.93 + var(--zre-ep, 1) * .07)); transform-origin: 50% 100%; }
html.zre-motion .zre-hp .zre-feature__img { transform: translateY(calc((1 - var(--zre-ep, 1)) * 90px)); }

/* ---------- Homepage: testimonial fills in as you scroll ---------- */
html.zre-motion .zre-hp .zre-proof__quote { background: linear-gradient(172deg, var(--zre-ink, #1d1d1f) calc(var(--zre-fp, 1) * 150% - 30%), #d2d2d7 calc(var(--zre-fp, 1) * 150% - 5%)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Homepage: closing line grows into place ---------- */
html.zre-motion .zre-hp .zre-cta__title { transform: scale(calc(.86 + var(--zre-ep, 1) * .14)); }

/* ---------- Homepage: buttons lean toward the cursor (desktop only) ---------- */
html.zre-motion .zre-hp .zre-mag.zre-pull { transition: translate .12s linear, scale .18s ease, background-color .25s ease; }

/* ---------- Optional: gliding underline for any tab row ---------- */
/* Add class="zre-glide" to a role="tablist" whose tabs use aria-selected. */
html.zre-motion .zre-glide { position: relative; }
html.zre-motion .zre-glide__ink { position: absolute; bottom: -1px; left: 0; height: 3px; width: 0; border-radius: 3px; background: var(--zre-navy, #0a1f36); transition: left .45s cubic-bezier(.2, .7, .2, 1), width .45s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }

/* ---------- Listing pages ---------- */
/* Photos settle in, then hovering one gently dims the others */
html.zre-motion .zre-hp .zre-gal__item { animation: zrePhoto 1.1s cubic-bezier(.2, .7, .2, 1) both; cursor: zoom-in; }
html.zre-motion .zre-hp .zre-gal__item:nth-child(2) { animation-delay: .08s; }
html.zre-motion .zre-hp .zre-gal__item:nth-child(3) { animation-delay: .14s; }
html.zre-motion .zre-hp .zre-gal__item:nth-child(4) { animation-delay: .2s; }
html.zre-motion .zre-hp .zre-gal__item:nth-child(n+5) { animation-delay: .26s; }
@keyframes zrePhoto { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
html.zre-motion .zre-hp .zre-gal__item img { transition: transform .6s ease, filter .45s ease; }
html.zre-motion .zre-hp .zre-gal__grid:hover .zre-gal__item img { filter: brightness(.82) saturate(.9); }
html.zre-motion .zre-hp .zre-gal__grid:hover .zre-gal__item:hover img { filter: none; }
/* Price card slides in, and moves up when the header tucks away */
@media (min-width: 981px) {
	html.zre-motion .zre-hp .zre-side { animation: zreSide .9s cubic-bezier(.2, .7, .2, 1) .25s both; transition: top .5s cubic-bezier(.2, .7, .2, 1); }
	html.zre-motion.zre-tuck .zre-hp .zre-side { top: 24px; }
	html.zre-motion.zre-tuck body.admin-bar .zre-hp .zre-side { top: 56px; }
}
@keyframes zreSide { from { opacity: 0; translate: 24px 0; } to { opacity: 1; translate: 0 0; } }

/* ---------- Reduce motion: everything still, nothing hidden ---------- */
@media (prefers-reduced-motion: reduce) {
	html.zre-motion .zre-hp *,
	html.zre-motion .zre-hp *::after { animation: none !important; transition: none !important; }
	html.zre-motion .zre-hp .zre-rv,
	html.zre-motion .zre-hp .zre-hero__title { opacity: 1 !important; transform: none !important; }
	html.zre-motion .zre-hp .zre-line > span { transform: none !important; }
	html.zre-motion.zre-tuck .zre-hp .zre-hdr { transform: none; }
}
