/* ==========================================================================
   Home page motion (driven by assets/js/home-anim.js). Only active on html.ha,
   which the script sets when the visitor allows motion.
   ========================================================================== */

/* ---------- scroll reveals ---------- */
html.ha [data-ha] {
    opacity: 0;
    transition:
        opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1),
        transform 1s cubic-bezier(0.2, 0.7, 0.2, 1),
        clip-path 1.2s cubic-bezier(0.7, 0, 0.2, 1);
    transition-delay: calc(var(--ha-i, 0) * 85ms);
    will-change: opacity, transform;
}

html.ha [data-ha="up"] { transform: translate3d(0, 42px, 0); }
html.ha [data-ha="left"] { transform: translate3d(-56px, 0, 0); }
html.ha [data-ha="right"] { transform: translate3d(56px, 0, 0); }
html.ha [data-ha="zoom"] { transform: translate3d(0, 24px, 0) scale(0.9); }
html.ha [data-ha="wipe"] { clip-path: inset(0 0 0 100% round var(--ui-radius)); }

html.ha [data-ha].ha-in,
html.ha-done [data-ha] {
    opacity: 1;
    transform: none;
}

/* only wiped images keep a clip shape; anything else may draw outside its box (frames, shadows) */
html.ha [data-ha="wipe"].ha-in,
html.ha-done [data-ha="wipe"] {
    clip-path: inset(0 0 0 0 round var(--ui-radius));
}

/* wiped images also settle from a slight zoom; the picture ends at its full size */
html.ha [data-ha="wipe"] img {
    transform: scale(1.12);
    transition: transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

html.ha [data-ha="wipe"].ha-in img {
    transform: scale(1);
}

/* gentle parallax on the image frames (the frame moves, the picture is never cropped) */
.ha-parallax.ha-in {
    transform: translate3d(0, var(--ha-par, 0), 0) !important;
    transition: opacity 0.9s, clip-path 1.2s cubic-bezier(0.7, 0, 0.2, 1), transform 0.25s linear !important;
}

/* ---------- headings: gold underline draws in ---------- */
.ha-title {
    position: relative;
    padding-bottom: 18px;
}

.ha-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--ui-gold), var(--ui-green));
    transition: width 0.9s 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.lv-head .ha-title::after,
.lv-prose--center > .ha-title::after,
.lv-cta > .ha-title::after,
.text-center > .ha-title::after {
    left: 50%;
    transform: translateX(-50%);
}

.lv-prose--center > .ha-title {
    text-align: center;
}

html.ha .ha-title.ha-in::after,
html.ha-done .ha-title::after {
    width: 72px;
}

/* ---------- amenity tiles: lift + icon bounce on hover ---------- */
@keyframes haBob {
    0%, 100% { transform: translateY(0) rotate(0); }
    30% { transform: translateY(-8px) rotate(-6deg); }
    60% { transform: translateY(-3px) rotate(4deg); }
}

.lv-tile {
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.4s, border-color 0.4s;
}

.lv-tile:hover {
    border-color: rgba(255, 204, 41, 0.6);
    box-shadow: var(--ui-shadow);
    transform: translateY(-8px);
}

.lv-tile:hover img {
    animation: haBob 0.9s ease;
}

html.ha .lv-tile[data-ha].ha-in:hover {
    transform: translateY(-8px);
}

/* ---------- gallery: zoom + badge on hover ---------- */
.lv-gallery a {
    position: relative;
}

.lv-gallery a::after {
    content: "+";
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 204, 41, 0.95);
    color: var(--ui-ink);
    font-size: 28px;
    font-weight: 700;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
    transition: opacity 0.35s, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.lv-gallery a:hover::after,
.lv-gallery a:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.lv-gallery a:hover img {
    transform: scale(1.08);
}

/* ---------- cards: reviews and stats lift on hover ---------- */
.lv-review,
.lv-stats li {
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.4s, border-color 0.4s;
}

.lv-review:hover,
.lv-stats li:hover {
    transform: translateY(-6px);
}

.lv-review:hover {
    box-shadow: var(--ui-shadow);
}

.lv-stats strong {
    font-variant-numeric: tabular-nums;
}

/* ---------- dark bands: slow colour drift ---------- */
@keyframes haDrift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

#main-content .lv-section--dark:not(.lv-section--photo) {
    background: linear-gradient(120deg, #1f3a0c 0%, #2c4f12 35%, #3a6418 55%, #2c4f12 75%, #1f3a0c 100%);
    background-size: 240% 240%;
    animation: haDrift 18s ease-in-out infinite;
}

/* ---------- buttons: light sweep on hover ---------- */
#main-content .ui-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

#main-content .ui-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    z-index: -1;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

#main-content .ui-btn:hover::before {
    left: 140%;
}

/* ---------- page scroll progress ---------- */
.ha-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--ui-gold), var(--ui-green));
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

/* ---------- reduced motion: everything visible and still ---------- */
@media (prefers-reduced-motion: reduce) {
    html.ha [data-ha],
    html.ha [data-ha="wipe"] img {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
        transition: none !important;
    }

    #main-content .lv-section--dark:not(.lv-section--photo),
    .lv-tile:hover img {
        animation: none;
    }

    .ha-progress {
        display: none;
    }
}
