/* Pass A — scroll impact layouts (Home trust + About) */

/* ---- Home cinematic hero intro ---- */
.hero-cinematic-brand {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    margin: 0;
    padding: 0 max(0.4rem, env(safe-area-inset-right, 0px)) max(0.1rem, env(safe-area-inset-bottom, 0px)) max(0.4rem, env(safe-area-inset-left, 0px));
    pointer-events: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.35rem, 0.9vw, 0.75rem);
    overflow: hidden;
    box-sizing: border-box;
}

.hero-cinematic-crown-wrap {
    position: relative;
    display: block;
    width: clamp(9rem, 22vw, 20rem);
    line-height: 0;
}

.hero-cinematic-crown {
    display: block;
    width: 100%;
    height: auto;
    mix-blend-mode: screen;
    user-select: none;
}

/* Minimal glint on the crown's center tip */
.hero-cinematic-crown-glint {
    position: absolute;
    top: 6%;
    left: 50%;
    width: 14%;
    height: 28%;
    margin-left: -7%;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(250, 248, 245, 0.85) 0%,
        rgba(201, 165, 92, 0.35) 35%,
        transparent 70%
    );
    mix-blend-mode: screen;
    opacity: 0;
    transform: scale(0.4);
    will-change: opacity, transform;
}

.hero-cinematic-wordmark {
    margin: 0;
    width: 100%;
    max-width: 100%;
    text-align: center;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-weight: 600;
    /* JS fitToWidth sets exact size; this is a safe start */
    font-size: 4vw;
    line-height: 0.92;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: visible;
    color: #faf8f5;
    padding: 0;
    box-sizing: border-box;
}

/* Mount brand layout, keep invisible until GSAP starts (no double flash) */
html.js-anim body.cinematic-splash .hero-cinematic-brand {
    display: flex;
    opacity: 0;
}

html.js-anim body.cinematic-mobile-lite .hero-cinematic-brand,
.hero-cinematic-brand[hidden] {
    display: none !important;
}

html.js-anim body.cinematic-intro {
    overflow: hidden;
}

/* Hard-hide chrome/UI for whole splash — kill main.css fadeInUp leaks */
html.js-anim body.cinematic-splash .header,
html.js-anim body.cinematic-splash [data-cinematic-ui],
html.js-anim body.cinematic-splash .floating-call-widget {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* After splash: GSAP owns reveal (inline opacity beats these) */
html.js-anim body.cinematic-intro .header {
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

html.js-anim body.cinematic-intro .header.scrolled {
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.js-anim body.cinematic-intro [data-cinematic-ui] {
    opacity: 0;
    pointer-events: none;
}

/* Kill legacy main.css / km translate during intro — opacity only for GSAP fade */
html.js-anim body.page-home.cinematic-intro .hero-title,
html.js-anim body.page-home.cinematic-intro .hero-subtitle,
html.js-anim body.page-home.cinematic-intro .hero-actions,
html.js-anim body.page-home.cinematic-intro .hero-search,
html.js-anim body.page-home.cinematic-intro .hero-badge,
html.js-anim body.page-home.cinematic-intro [data-motion-hero-item],
html.js-anim body.page-home.cinematic-intro [data-motion-hero-item]:not(.km-hero-in) {
    animation: none !important;
    transform: none !important;
}

/* After intro: keep revealed items solid (kmHeroIn fill-mode both can snap to 0) */
html.js-anim body.page-home.cinematic-done [data-motion-hero-item].km-hero-locked {
    opacity: 1;
    transform: none;
    animation: none !important;
}

/* Prevent main.css fadeInUp from replaying when cinematic-intro lifts */
html.js-anim body.page-home.cinematic-done .hero-title,
html.js-anim body.page-home.cinematic-done .hero-subtitle,
html.js-anim body.page-home.cinematic-done .hero-actions,
html.js-anim body.page-home.cinematic-done .hero-search,
html.js-anim body.page-home.cinematic-done .hero-badge {
    animation: none !important;
    opacity: 1;
}

/* Kill split-hero CSS ken-burns during splash (no zoom/dezoom with wordmark) */
html.js-anim body.cinematic-splash .hero-carousel-container .slide-bg img,
html.js-anim body.cinematic-splash .hero-slide.active .slide-bg img {
    transform: scale(1) !important;
    transition: none !important;
}

/* After splash, GSAP owns scale; don't let 6s CSS fight it */
html.js-anim body.cinematic-done .hero-carousel-container .slide-bg img,
html.js-anim body.cinematic-intro:not(.cinematic-splash) .hero-carousel-container .slide-bg img {
    transition: none;
}

@media (max-width: 991px) {
    .hero-cinematic-brand,
    html.js-anim body.cinematic-intro .hero-cinematic-brand,
    html.js-anim body.cinematic-splash .hero-cinematic-brand,
    html.js-anim body.cinematic-mobile-lite .hero-cinematic-brand {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-cinematic-brand {
        display: none !important;
    }
}

/* Laptop: wordmark near bottom with light padding (not mid-screen) */
@media (min-width: 992px) and (max-width: 1366px) {
    html.js-anim body.page-home.cinematic-splash .hero-cinematic-brand {
        inset: auto 0 0;
        height: auto;
        justify-content: flex-end;
        padding: 0 max(0.4rem, env(safe-area-inset-right, 0px))
            clamp(1.25rem, 3.5vh, 2.25rem) max(0.4rem, env(safe-area-inset-left, 0px));
    }

    .hero-cinematic-crown-wrap {
        width: clamp(7rem, 16vw, 14rem);
    }
}

/* ---- Trust: sticky expand ---- */
.trust-section.trust-scroll-section {
    overflow: visible;
    padding: 0;
}

.trust-scroll-pin {
    padding: clamp(3.5rem, 8vw, 5.5rem) 0;
    min-height: 0;
    display: flex;
    align-items: center;
}

.trust-wrapper-scroll {
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
}

.trust-visual-scroll {
    position: relative;
}

.trust-image-frame {
    overflow: hidden;
    border-radius: 1.25rem;
    box-shadow: 0 28px 60px rgba(8, 16, 28, 0.45);
    will-change: transform, border-radius;
    background: rgba(0, 0, 0, 0.2);
}

.trust-image-frame img {
    width: 100%;
    height: 100%;
    min-height: clamp(280px, 52vh, 520px);
    object-fit: cover;
    display: block;
    will-change: transform;
}

/* ---- About hero: fall + open from top-right ---- */
.about-hero-reveal[data-scroll-about-hero] {
    /* sizing owned by pages-brand.css */
}

.about-hero-media-frame,
.about-hero-media-frame img,
.about-hero-media-shade,
.about-hero-media-caption {
    will-change: transform, opacity, clip-path;
}

/* ---- Territories parallax ---- */
.about-territory-showcase[data-scroll-territories] {
    align-items: stretch;
}

.about-territory-showcase [data-parallax] {
    will-change: transform;
}

.about-territory-card {
    overflow: hidden;
}

.about-territory-card img {
    will-change: transform;
    transform-origin: center center;
}

/* ---- Pass B: featured clip-zoom ---- */
.featured-scroll-section [data-clip-media] {
    overflow: hidden;
}

.featured-scroll-section [data-clip-zoom] {
    transform-origin: center center;
    will-change: transform;
}

/* ---- Pass C: soft page motion ---- */
[data-scroll-listings-hero] .page-hero-photo-bg,
[data-scroll-contact-hero] .page-hero-photo-bg {
    overflow: hidden;
}

[data-listings-hero-img],
[data-contact-hero-img] {
    will-change: transform;
    transform-origin: center center;
}

[data-filters-bar] {
    will-change: transform, opacity;
}

[data-scroll-quick-bar] .contact-quick-grid {
    will-change: transform, opacity;
}

[data-map-clip] {
    will-change: clip-path, opacity;
    overflow: hidden;
}

[data-scroll-gallery] {
    overflow: hidden;
}

[data-gallery-zoom] {
    will-change: transform;
    transform-origin: center center;
}

/* ---- Home zoom parallax collage ---- */
.zoom-parallax-section {
    background: #122236;
    color: #faf8f5;
    padding-top: clamp(3.5rem, 8vw, 5.5rem);
}

.zoom-parallax-intro {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto;
    padding-bottom: clamp(2rem, 5vw, 3.5rem);
}

.zoom-parallax-intro .brand-kicker {
    color: #c9a55c;
}

.zoom-parallax-intro .brand-section-title {
    color: #faf8f5;
    margin: 0.5rem 0 0.75rem;
}

.zoom-parallax-intro .brand-section-desc {
    color: rgba(250, 248, 245, 0.72);
    margin: 0 auto;
}

.zoom-parallax {
    position: relative;
    height: 300vh;
}

.zoom-parallax-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: #122236;
}

.zoom-parallax-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    transform-origin: center center;
}

.zoom-parallax-frame {
    position: relative;
    height: 25vh;
    width: 25vw;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 18px 48px rgba(8, 16, 28, 0.45);
}

.zoom-parallax-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Slot positions (collage layout) */
.zoom-parallax-layer[data-zoom-slot="1"] .zoom-parallax-frame {
    top: -30vh;
    left: 5vw;
    height: 30vh;
    width: 35vw;
}

.zoom-parallax-layer[data-zoom-slot="2"] .zoom-parallax-frame {
    top: -10vh;
    left: -25vw;
    height: 45vh;
    width: 20vw;
}

.zoom-parallax-layer[data-zoom-slot="3"] .zoom-parallax-frame {
    left: 27.5vw;
    height: 25vh;
    width: 25vw;
}

.zoom-parallax-layer[data-zoom-slot="4"] .zoom-parallax-frame {
    top: 27.5vh;
    left: 5vw;
    height: 25vh;
    width: 20vw;
}

.zoom-parallax-layer[data-zoom-slot="5"] .zoom-parallax-frame {
    top: 27.5vh;
    left: -22.5vw;
    height: 25vh;
    width: 30vw;
}

.zoom-parallax-layer[data-zoom-slot="6"] .zoom-parallax-frame {
    top: 22.5vh;
    left: 25vw;
    height: 15vh;
    width: 15vw;
}

@media (max-width: 991px) {
    .zoom-parallax {
        height: auto;
        padding: 0 1.25rem 3rem;
    }

    .zoom-parallax-sticky {
        position: relative;
        height: auto;
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        grid-template-rows: auto auto auto;
        gap: 0.65rem;
        overflow: visible;
    }

    .zoom-parallax-layer {
        position: relative;
        inset: auto;
        display: block;
        transform: none !important;
    }

    .zoom-parallax-frame,
    .zoom-parallax-layer[data-zoom-slot] .zoom-parallax-frame {
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        border-radius: 6px;
        box-shadow: none;
    }

    .zoom-parallax-layer[data-zoom-slot="0"] {
        grid-column: 1 / -1;
    }

    .zoom-parallax-layer[data-zoom-slot="0"] .zoom-parallax-frame {
        aspect-ratio: 16 / 10;
    }

    .zoom-parallax-layer[data-zoom-slot="5"],
    .zoom-parallax-layer[data-zoom-slot="6"] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zoom-parallax {
        height: auto;
        padding: 0 1.25rem 3rem;
    }

    .zoom-parallax-sticky {
        position: relative;
        height: auto;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.65rem;
    }

    .zoom-parallax-layer {
        position: relative;
        transform: none !important;
    }

    .zoom-parallax-frame,
    .zoom-parallax-layer[data-zoom-slot] .zoom-parallax-frame {
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 991px) {
    .trust-scroll-pin {
        min-height: 0;
        padding: 3rem 0;
    }

    .trust-image-frame img {
        min-height: 240px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .trust-image-frame,
    .trust-image-frame img,
    .about-hero-media-frame,
    .about-hero-media-frame img,
    .about-territory-showcase [data-parallax],
    .about-territory-card img,
    .featured-scroll-section [data-clip-zoom],
    [data-listings-hero-img],
    [data-contact-hero-img],
    [data-filters-bar],
    [data-scroll-quick-bar] .contact-quick-grid,
    [data-map-clip],
    [data-gallery-zoom] {
        transform: none !important;
        clip-path: none !important;
        will-change: auto;
    }
}
