/**
 * Pin for Life — Osmo-inspired motion layer
 * Patterns inspired by https://www.osmo.supply/ (masked reveal, directional hover, smooth scroll)
 */

/* ——— Loader: masked word + window exit ——— */
.loading-container {
    clip-path: inset(0% 0% 0% 0% round 0);
    will-change: clip-path;
}

.loading-words {
    position: relative;
}

.pfl-loader-words__mask {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    line-height: 1.15;
    min-width: 8ch;
    text-align: left;
}

.pfl-loader-words__text {
    display: block;
    will-change: transform;
}

.loading-container.is-exiting {
    pointer-events: none;
}

/* ——— Directional hover (list / cards) ——— */
.pfl-hover-item {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
}

.pfl-hover-item__inner {
    display: flex;
    flex-direction: column;
    align-items: inherit;
    justify-content: inherit;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.pin-for-life-amenity-card.pfl-hover-item {
    align-items: center;
    justify-content: center;
}

.pin-for-life-amenity-card.pfl-hover-item .pfl-hover-item__inner {
    align-items: center;
    text-align: center;
}

.about-stat-card.pfl-hover-item .pfl-hover-item__inner {
    align-items: flex-start;
}

/* Shine sweep on hover (Osmo-style card sheen) */
.pfl-hover-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 42%,
        rgba(228, 212, 168, 0.22) 50%,
        transparent 58%
    );
    transform: translateX(-120%);
    transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    border-radius: inherit;
}

.pfl-hover-item:hover::after {
    transform: translateX(120%);
}

@media (prefers-reduced-motion: reduce) {
    .pfl-hover-item::after {
        display: none;
    }
}

/* ——— Magnetic controls ——— */
.pfl-magnetic {
    position: relative;
    display: inline-flex;
    will-change: transform;
}

.pfl-magnetic__wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

/* ——— Amenity slider: GSAP flick track ——— */
.pfl-amenity-flick {
    touch-action: pan-x;
    -webkit-user-select: none;
    user-select: none;
}

#amenity-slider-track {
    touch-action: pan-x;
    will-change: transform;
}

#amenity-slider-track.is-dragging {
    transition: none !important;
    cursor: grabbing;
}

.amenity-text-slide__inner {
    will-change: transform, opacity;
}

/* ——— Spec cards: subtle 3D tilt on desktop ——— */
@media (min-width: 1024px) {
    #spec-slider .snap-start.pfl-tilt-card {
        perspective: 900px;
        transform-style: preserve-3d;
    }

    #spec-slider .snap-start.pfl-tilt-card > div {
        transform-style: preserve-3d;
        transition: transform 0.05s linear;
    }
}

/* ——— Menu links: directional underline zone ——— */
.pfl-menu__nav a {
    position: relative;
}

.pfl-shree .pfl-menu__nav a {
    display: inline-flex;
}

/* Lenis: keep modals / menu scrollable */
[data-lenis-prevent] {
    overscroll-behavior: contain;
}

html.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

html.lenis.lenis-smooth body {
    height: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

/* ——— Mobile / touch (Osmo interactions) ——— */
@media (max-width: 767px) {
    .loading-container {
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    }

    .loading-words {
        font-size: clamp(1rem, 4.5vw, 1.35rem);
        gap: 0.55rem;
    }

    .pfl-loader-words__mask {
        max-width: min(92vw, 18rem);
    }

    .pfl-hover-item {
        -webkit-tap-highlight-color: transparent;
    }

    .pfl-hover-item.is-pressed {
        border-color: rgba(228, 212, 168, 0.55);
    }

    .pin-for-life-amenity-card.pfl-hover-item.is-pressed {
        background-color: rgba(255, 250, 231, 0.12);
    }

    .about-stat-card.pfl-hover-item.is-pressed {
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(14, 36, 4, 0.1);
    }

    .hero-cta-mobile.pfl-magnetic {
        display: inline-flex !important;
        width: auto;
        max-width: calc(100% - 1rem);
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
    }

    .hero-cta-mobile.pfl-magnetic .pfl-magnetic__wrap {
        width: 100%;
        justify-content: center;
        padding: 0 0.25rem;
    }

    .pfl-menu .pfl-arrow-link.pfl-magnetic {
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
    }

    .pfl-amenity-flick {
        margin-bottom: 1.5rem;
        border-radius: 1rem;
    }

    #amenity-slider-track {
        height: min(52vh, 380px) !important;
    }

    .amenity-text-slide__inner {
        padding: clamp(1.25rem, 5vw, 2rem) max(1.25rem, env(safe-area-inset-left, 0px) + 1rem);
        text-align: left;
    }

    .amenity-text-slide__title {
        font-size: clamp(1.35rem, 6vw, 1.85rem);
        line-height: 1.15;
    }

    .amenity-text-slide__desc {
        font-size: clamp(0.85rem, 3.6vw, 1rem);
        line-height: 1.5;
    }

    #amenity-indicators {
        bottom: max(1rem, env(safe-area-inset-bottom, 0px) + 0.35rem) !important;
        gap: 0.5rem;
    }

    #amenity-indicators button {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent !important;
        border: none;
    }

    #amenity-indicators button::after {
        content: "";
        display: block;
        border-radius: 9999px;
        transition: width 0.3s ease, background-color 0.3s ease;
    }

    #amenity-indicators button.w-10::after {
        width: 2.5rem;
        height: 0.75rem;
        background-color: #e4d4a8;
    }

    #amenity-indicators button.w-3::after {
        width: 0.75rem;
        height: 0.75rem;
        background-color: rgba(255, 255, 255, 0.25);
    }

    #amenity-prev,
    #amenity-next {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    #amenity-prev {
        left: max(0.75rem, env(safe-area-inset-left, 0px) + 0.5rem);
    }

    #amenity-next {
        right: max(0.75rem, env(safe-area-inset-right, 0px) + 0.5rem);
    }

    #spec-slider .snap-start.pfl-tap-card {
        scroll-snap-align: center;
    }

    #spec-slider .snap-start.pfl-tap-card > div {
        will-change: transform;
    }

    .pfl-directional-list {
        gap: 0.65rem;
    }

    .pin-for-life-amenity-card.pfl-hover-item {
        min-height: 132px;
    }
}

/* Touch devices: no hover sheen (tap uses .is-pressed) */
@media (hover: none), (pointer: coarse) {
    .pfl-hover-item:hover::after {
        transform: translateX(-120%);
    }

    .pfl-hover-item.is-pressed::after {
        transform: translateX(120%);
    }
}

/* Native scroll on touch — Lenis does not block momentum */
html.pfl-touch-ui.lenis.lenis-smooth {
    height: 100%;
}
