/**
 * LIVZO — "Real resident experiences" (homepage module 3).
 *
 * The human layer under the society scores: two columns — the illustration with a row of
 * two reviews beneath it on the left, two more stacked on the right, over a faint community
 * network. Every card is the same compact review card. Same tokens and motion language as
 * the hero and societies modules.
 *
 * Motion index
 *   reveal-on-scroll → [data-lz-inview] + .is-in (assets/js/societies.js)
 *   ambient          → glow drift, network dash crawl, floating pins
 *   hover            → card lift, topic pills, verified badge, helpful button
 */

/* ==========================================================================
   1. Shell + decorative background
   ========================================================================== */

.lz-experiences {
    position: relative;
    isolation: isolate;
    padding: clamp(60px, 6.6vw, 96px) 0 clamp(68px, 8vw, 100px);
    scroll-margin-top: calc(var(--lz-header-h) + 16px);
}

.lz-experiences__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.lz-experiences__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
}

.lz-experiences__glow--a {
    top: -14%;
    right: -8%;
    width: min(44vw, 520px);
    aspect-ratio: 1;
    background-image: radial-gradient(circle at 50% 50%, rgba(109, 74, 255, 0.16), rgba(109, 74, 255, 0) 70%);
    animation: lzDrift 24s ease-in-out infinite;
}

.lz-experiences__glow--b {
    bottom: -20%;
    left: -10%;
    width: min(40vw, 480px);
    aspect-ratio: 1;
    background-image: radial-gradient(circle at 50% 50%, rgba(109, 74, 255, 0.11), rgba(109, 74, 255, 0) 70%);
    animation: lzDrift 30s ease-in-out infinite reverse;
}

.lz-experiences__dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(11, 27, 51, 0.055) 1.4px, transparent 1.4px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 0%, transparent 76%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 0%, transparent 76%);
}

/* Resident community network: profile circles joined by faint routes. */
.lz-experiences__net {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: var(--lz-accent);
    opacity: 0.15;
}

.lz-experiences__net path {
    animation: lzNetDash 30s linear infinite;
}

.lz-experiences__net path:nth-of-type(2) {
    animation-duration: 38s;
    animation-direction: reverse;
}

@keyframes lzNetDash {
    to { stroke-dashoffset: -150; }
}

.lz-experiences__pin {
    position: absolute;
    color: var(--lz-accent);
}

.lz-experiences__pin .lz-icon { width: 100%; height: 100%; }

.lz-experiences__pin--a {
    top: 20%;
    left: 2.5%;
    width: 24px;
    opacity: 0.10;
    animation: lzFloat 13s ease-in-out infinite;
}

.lz-experiences__pin--b {
    top: 62%;
    right: 4%;
    width: 18px;
    opacity: 0.09;
    animation: lzFloat 16s ease-in-out infinite reverse;
}

.lz-experiences__pin--c {
    top: 8%;
    right: 26%;
    width: 15px;
    opacity: 0.07;
    animation: lzFloat 11s ease-in-out infinite;
}

/* ==========================================================================
   2. Section header
   ========================================================================== */

.lz-experiences__head {
    max-width: 880px;
}

.lz-experiences__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--lz-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.lz-experiences__eyebrow-ico {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--lz-accent-soft);
    color: var(--lz-accent);
    animation: lzPulse 3.4s var(--lz-ease) infinite;
}

.lz-experiences__eyebrow-ico .lz-icon { width: 14px; height: 14px; }

.lz-experiences__title {
    margin-top: 14px;
    font-size: clamp(1.9rem, 1.25rem + 2.05vw, 2.9rem);
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.lz-experiences__title-accent {
    background-image: linear-gradient(100deg, var(--lz-accent-700) 0%, var(--lz-accent) 34%, #045e55 62%, var(--lz-accent) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: var(--lz-accent);
    -webkit-text-fill-color: transparent;
    animation: lzAccentFlow 9s var(--lz-ease) infinite;
}

.lz-experiences__lead {
    margin-top: 14px;
    max-width: 62ch;
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
    line-height: 1.7;
    color: var(--lz-body);
}

/* ==========================================================================
   3. Two columns — illustration + review row left, reviews right
   ========================================================================== */

.lz-experiences__grid {
    display: grid;
    gap: clamp(18px, 1.8vw, 24px);
    margin-top: clamp(30px, 3.6vw, 48px);
}

/* The left column: the illustration above a single row of two review cards. */
.lz-experiences__lead,
.lz-experiences__pair,
.lz-experiences__stack {
    display: grid;
    gap: clamp(14px, 1.4vw, 18px);
    min-width: 0;
}

.lz-experiences__lead { gap: clamp(18px, 1.8vw, 24px); }

.lz-experiences__item {
    display: flex;
    min-width: 0;
}

.lz-experiences__figure {
    overflow: hidden;
    border: 1px solid var(--lz-line);
    border-radius: 22px;
    background-color: var(--lz-surface);
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.05), 0 20px 44px -30px rgba(11, 27, 51, 0.34);
}

.lz-experiences__img {
    display: block;
    width: 100%;
    height: auto;
}

/* Tablet and up: the two review cards sit side by side under the illustration, exactly
   like the right column's own pair. Below that they stack, because two 150px-wide cards
   cannot hold a headline. */
@media (min-width: 700px) {
    .lz-experiences__pair,
    .lz-experiences__stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Desktop: the wide column on the left, the two stacked reviews on the right. */
@media (min-width: 1280px) {
    .lz-experiences__grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
        align-items: stretch;
    }

    .lz-experiences__stack { grid-template-columns: 1fr; }
}

/* Only one column of cards (a young database) — let the lead block use the full width. */
.lz-experiences__grid--solo .lz-experiences__lead { grid-column: 1 / -1; }

/* ==========================================================================
   4. Experience card
   ========================================================================== */

.lz-experience {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 14px;
    min-width: 0;
    padding: 22px 22px 20px;
    border: 1px solid var(--lz-line);
    border-radius: 22px;
    background-color: var(--lz-surface);
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.05), 0 20px 44px -30px rgba(11, 27, 51, 0.34);
    transition: transform 0.28s var(--lz-ease-out),
        box-shadow 0.28s var(--lz-ease-out),
        border-color 0.28s var(--lz-ease-out);
}

.lz-experience:hover,
.lz-experience:focus-within {
    transform: translateY(-4px);
    border-color: rgba(109, 74, 255, 0.20);
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.05), 0 30px 58px -30px rgba(11, 27, 51, 0.40),
        0 16px 32px -26px rgba(109, 74, 255, 0.40);
}

/* --- Card header ------------------------------------------------------- */

/* Clamped to two lines so a long author headline cannot make one card taller than its
   neighbours in the same row — every card in the section is the same weight. */
.lz-experience__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.34;
}

.lz-experience__rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

/* --- Quote ------------------------------------------------------------- */

/* Two lines, same reason as the title: the word limit is what keeps the row even. */
.lz-experience__text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    color: var(--lz-ink);
    font-size: 0.9rem;
    line-height: 1.58;
}

/* --- View more --------------------------------------------------------- */

.lz-experience__more { margin-top: 2px; }

.lz-experience__more-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--lz-accent-700);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--lz-t) var(--lz-ease-out), border-color var(--lz-t) var(--lz-ease-out);
}

.lz-experience__more-link:hover {
    color: var(--lz-accent);
    border-bottom-color: var(--lz-accent-soft-2);
}

.lz-experience__more-arrow {
    width: 13px;
    height: 13px;
    transition: transform 0.25s var(--lz-ease-out);
}

.lz-experience__more-link:hover .lz-experience__more-arrow { transform: translateX(2px); }

/* --- Topic tags -------------------------------------------------------- */

.lz-experience__topics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.lz-topic {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px 5px 8px;
    border: 1px solid var(--lz-line);
    border-radius: var(--lz-r-pill);
    background-color: var(--lz-bg-2);
    color: var(--lz-body);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    white-space: nowrap;
    transition: background-color 0.25s var(--lz-ease),
        border-color 0.25s var(--lz-ease),
        color 0.25s var(--lz-ease),
        transform 0.25s var(--lz-ease-out);
}

.lz-topic__ico {
    display: grid;
    place-items: center;
    color: var(--lz-accent);
}

.lz-topic__ico .lz-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.25s var(--lz-ease-out);
}

/* Interactive variant (bottom strip) */
.lz-topic--link {
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.04);
}

.lz-topic--link:hover,
.lz-topic--link:focus-visible {
    background-color: var(--lz-accent-soft);
    border-color: rgba(109, 74, 255, 0.26);
    color: var(--lz-accent-700);
    transform: translateY(-1px);
}

.lz-topic--link:hover .lz-topic__ico,
.lz-topic--link:focus-visible .lz-topic__ico { transform: translateY(-1px) scale(1.12); }

/* --- Footer: resident identity + helpful ------------------------------- */

.lz-experience__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--lz-line);
}

.lz-resident {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.lz-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    overflow: hidden;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px -12px rgba(11, 27, 51, 0.75);
    transition: transform 0.28s var(--lz-ease-out);
}

.lz-avatar svg { width: 100%; height: 100%; }

/* A resident's own uploaded picture, filling the circle. */
.lz-avatar__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* A resident who keeps their photo private gets their initials instead — the variant's
   gradient is the background, so the circle reads exactly like the photo version. */
.lz-avatar__initials {
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
}

.lz-avatar--a { background-image: linear-gradient(150deg, #8A6BFF, #5A37F0); }
.lz-avatar--b { background-image: linear-gradient(150deg, #3C5B86, #0B1B33); }
.lz-avatar--c { background-image: linear-gradient(150deg, #7E8BB5, #46557A); }
/* The hash can return `d`; without this the fourth variant rendered a transparent circle. */
.lz-avatar--d { background-image: linear-gradient(150deg, #4E6BB0, #263D69); }

.lz-experience:hover .lz-avatar { transform: scale(1.04); }

.lz-resident__body {
    display: grid;
    gap: 5px;
    min-width: 0;
}

/* The author's public name — first name + last initial, the platform's display rule. Absent
   when the author has no profile, so the card never prints a placeholder in its place. */
.lz-resident__name {
    min-width: 0;
    overflow: hidden;
    color: var(--lz-navy);
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lz-resident__top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.lz-resident__tenure {
    color: var(--lz-muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.lz-resident__society {
    color: var(--lz-body);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* The society a review is about is the platform's central hub — always a link. */
.lz-resident__society-link {
    color: var(--lz-body);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--lz-t) var(--lz-ease-out), border-color var(--lz-t) var(--lz-ease-out);
}

.lz-resident__society-link:hover {
    color: var(--lz-accent);
    border-bottom-color: var(--lz-accent-soft-2);
}

/* --- Verification badge ------------------------------------------------ */

.lz-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 7px;
    border: 1px solid rgba(18, 161, 80, 0.22);
    border-radius: var(--lz-r-pill);
    background-color: var(--lz-green-soft);
    color: #0D7A3C;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    transition: background-color 0.25s var(--lz-ease),
        border-color 0.25s var(--lz-ease),
        transform 0.25s var(--lz-ease-out);
}

.lz-verified__ico {
    display: grid;
    place-items: center;
    color: var(--lz-green);
}

.lz-verified__ico .lz-icon { width: 13px; height: 13px; }

.lz-verified:hover {
    background-color: rgba(18, 161, 80, 0.18);
    border-color: rgba(18, 161, 80, 0.34);
    transform: translateY(-1px);
}

/* --- Tenant / owner label --------------------------------------------- */

.lz-perspective {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 0.63rem;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.lz-perspective--tenant {
    background-color: var(--lz-accent-soft);
    color: var(--lz-accent-700);
}

.lz-perspective--owner {
    background-color: rgba(11, 27, 51, 0.07);
    color: var(--lz-navy-2);
}

/* `resident` is the generic connection the database can hold, so it needs its own tint —
   without it the chip rendered with no background at all. */
.lz-perspective--resident {
    background-color: rgba(11, 27, 51, 0.05);
    color: var(--lz-body);
}

/* --- Helpful button ---------------------------------------------------- */

.lz-helpful {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    padding: 8px 12px;
    border: 1px solid var(--lz-line-2);
    border-radius: var(--lz-r-pill);
    background-color: #fff;
    color: var(--lz-body);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s var(--lz-ease),
        border-color 0.25s var(--lz-ease),
        color 0.25s var(--lz-ease),
        box-shadow 0.25s var(--lz-ease),
        transform 0.25s var(--lz-ease-out);
}

.lz-helpful:hover {
    background-color: var(--lz-accent-soft);
    border-color: rgba(109, 74, 255, 0.28);
    color: var(--lz-accent-700);
    transform: translateY(-1px);
}

.lz-helpful:active { transform: scale(0.97); }

.lz-helpful.is-on {
    background-image: linear-gradient(180deg, var(--lz-accent) 0%, var(--lz-accent-600) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 22px -14px rgba(109, 74, 255, 0.95);
}

.lz-helpful__ico {
    display: grid;
    place-items: center;
}

.lz-helpful__ico .lz-icon { width: 14px; height: 14px; }

.lz-helpful.is-on .lz-helpful__ico .lz-icon { animation: lzHelpPop 0.4s var(--lz-ease-out); }

@keyframes lzHelpPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.22) rotate(-8deg); }
    100% { transform: scale(1); }
}

.lz-helpful__count {
    color: var(--lz-navy);
    font-weight: 800;
    letter-spacing: -0.015em;
}

.lz-helpful.is-on .lz-helpful__count { color: #fff; }

/* ==========================================================================
   5. Bottom insight strip
   ========================================================================== */

.lz-experiences__strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
    margin-top: clamp(26px, 3.2vw, 40px);
    padding: 18px 22px;
    border: 1px solid var(--lz-line);
    border-radius: 20px;
    background-color: var(--lz-surface);
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.04), 0 18px 40px -32px rgba(11, 27, 51, 0.30);
}

.lz-experiences__strip-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    color: var(--lz-navy);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.lz-experiences__strip-ico {
    display: grid;
    place-items: center;
    color: var(--lz-accent);
}

.lz-experiences__strip-ico .lz-icon { width: 16px; height: 16px; }

.lz-experiences__strip-topics {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

.lz-experiences__strip-topics > li { flex: none; }

.lz-experiences__strip-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    margin-left: auto;
    color: var(--lz-accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.lz-experiences__strip-arrow {
    width: 17px;
    height: 17px;
    transition: transform 0.28s var(--lz-ease-out);
}

.lz-experiences__strip-link:hover .lz-experiences__strip-arrow { transform: translateX(4px); }

.lz-experiences__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--lz-muted);
    font-size: 0.76rem;
    line-height: 1.5;
    text-align: center;
}

.lz-experiences__note-ico {
    display: grid;
    place-items: center;
    flex: none;
    color: var(--lz-accent);
}

.lz-experiences__note-ico .lz-icon { width: 14px; height: 14px; }

/* ==========================================================================
   6. Reveal on scroll (scoped copy — the module stays self-contained)
   ========================================================================== */

.has-js .lz-experiences [data-lz-inview] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--lz-ease-out) var(--lz-delay, 0ms),
        transform 0.85s var(--lz-ease-out) var(--lz-delay, 0ms);
    will-change: opacity, transform;
}

.has-js .lz-experiences [data-lz-inview].is-in {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* ==========================================================================
   7. Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .lz-experience { border-radius: 20px; padding: 20px 18px 18px; }

    .lz-experiences__strip {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 13px;
        border-radius: 18px;
    }

    /* Topic pills become a horizontal scroller so the strip stays compact. */
    .lz-experiences__strip-topics {
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        margin-inline: -22px;
        padding: 2px 22px 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .lz-experiences__strip-topics::-webkit-scrollbar { display: none; }

    .lz-experiences__strip-link {
        margin-left: 0;
        align-self: flex-start;
    }
}

@media (max-width: 420px) {
    .lz-experience__foot { align-items: flex-start; }
    .lz-experiences__title { letter-spacing: -0.03em; }
}

/* ==========================================================================
   8. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .has-js .lz-experiences [data-lz-inview] {
        opacity: 1;
        transform: none;
    }

    .lz-experiences__title-accent,
    .lz-experiences__eyebrow-ico,
    .lz-experiences__glow,
    .lz-experiences__net path,
    .lz-experiences__pin {
        animation: none;
    }
}
