/*
 * Land Home Properties — motion
 *
 * Entrance reveals are armed only when the head script adds .js-motion
 * (JavaScript available, IntersectionObserver supported, reduced motion not
 * requested). Without that class every element is simply visible.
 * Movements are short and small; nothing loops continuously.
 */

/* ------------------------------------------------------- Entrance reveals */
.js-motion [data-reveal] {
    opacity: 0;
    transform: translate3d(0, var(--reveal-distance, 14px), 0);
    transition:
        opacity var(--duration-enter) var(--ease-out),
        transform var(--duration-enter) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
}

.js-motion [data-reveal='fade'] {
    --reveal-distance: 0px;
}

.js-motion [data-reveal='left'] {
    transform: translate3d(-14px, 0, 0);
}

.js-motion [data-reveal='right'] {
    transform: translate3d(14px, 0, 0);
}

.js-motion [data-reveal='scale'] {
    transform: scale(.98);
}

/* Headings stay visible (fast first paint) and settle into place. */
.js-motion [data-reveal='rise'] {
    --reveal-distance: 12px;
    opacity: 1;
}

.js-motion [data-reveal='image'] {
    --reveal-distance: 10px;
    transition-duration: 600ms;
}

.js-motion [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* The support-section architectural line draws itself once when revealed. */
.js-motion .roof-accent[data-reveal] path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 1.6s 300ms var(--ease-out);
}

.js-motion .roof-accent.is-visible path {
    stroke-dashoffset: 0;
}

/* Failsafe: if site.js never starts, show everything after a moment. */
html.js-motion:not(.motion-ready) [data-reveal] {
    animation: reveal-failsafe 1ms 2.5s forwards;
}

@keyframes reveal-failsafe {
    to {
        opacity: 1;
        transform: none;
    }
}

html.js-motion:not(.motion-ready) .roof-accent path {
    animation: line-failsafe 1ms 2.5s forwards;
}

@keyframes line-failsafe {
    to {
        stroke-dashoffset: 0;
    }
}

/* ----------------------------------------------------- Component keyframes */
@keyframes dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes alert-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes field-error-in {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
}

@keyframes check-draw {
    from {
        stroke-dashoffset: 24;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes lightbox-in {
    from {
        opacity: 0;
        transform: scale(.985);
    }
}

@keyframes field-nudge {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.js-motion .form-control.is-invalid.is-nudged,
.js-motion .form-select.is-invalid.is-nudged {
    animation: field-nudge 280ms var(--ease-out);
}

/* ------------------------------------------------------------ Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }

    .btn:active,
    .site-menu-toggle:active {
        transform: none;
    }

    .project-card:hover,
    .project-card:focus-within,
    .blog-card:hover,
    .blog-card:focus-within,
    .type-tile a:hover .type-tile__go,
    .project-card:hover img,
    .project-card:focus-within img,
    .blog-card:hover img,
    .blog-feature:hover img,
    .gallery__item:hover img,
    .gallery__item:focus-visible img,
    .type-tile a:hover img,
    .type-tile a:focus-visible img,
    .location-tile a:hover img,
    .location-tile a:focus-visible img,
    .owner-showcase--feature:hover .owner-showcase__media img,
    .hero-card__link:hover,
    .hero-card__link:hover .hero-card__go,
    .hero-slider__slide img {
        transform: none;
    }

}

/* Printing or saving a page always shows every section. */
@media print {
    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
}
