/* Homepage hero sequence. This file is the only owner of hero layers and actions. */

html.front-home-root,
body.public-front.front-home {
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
}

html.front-home-root::-webkit-scrollbar,
body.public-front.front-home::-webkit-scrollbar { display: none; }

.zf-sequence-preload {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.zf-scroll-hero {
    position: relative;
    height: 100svh;
    min-height: 100svh;
    overflow: hidden;
    --zf-progress: 0;
    --zf-frame-ready: 0;
    background: var(--zf-ivory);
    touch-action: none;
}

.zf-hero-sticky {
    position: relative;
    top: 0;
    height: 100svh;
    min-height: 720px;
    overflow: hidden;
    isolation: isolate;
}

.zf-hero-sequence {
    position: absolute;
    z-index: 0;
    inset: -1.5%;
    width: 103%;
    height: 103%;
    object-fit: cover;
    object-position: center center;
    background: var(--zf-sand);
    transform:
        scale(calc(1.035 - (var(--zf-progress) * .01)))
        translate3d(calc(var(--zf-progress) * -1.2vw), calc(var(--zf-progress) * -.55vh), 0);
    filter:
        saturate(calc(1.02 + (var(--zf-progress) * .16)))
        contrast(calc(1.04 + (var(--zf-progress) * .05)))
        brightness(1.04);
    opacity: 1;
    will-change: transform, filter;
    user-select: none;
    pointer-events: none;
}

.zf-hero-wash,
.zf-hero-grain,
.zf-hero-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.zf-hero-wash {
    z-index: 1;
    background:
        linear-gradient(90deg,
            rgba(247,240,226,.985) 0%,
            rgba(247,240,226,.90) 24%,
            rgba(247,240,226,.48) 49%,
            rgba(16,59,45,.15) 78%,
            rgba(16,59,45,.30) 100%),
        linear-gradient(180deg,
            rgba(255,250,238,.16) 0%,
            rgba(255,250,238,.025) 42%,
            rgba(14,43,31,.20) 100%);
}

.zf-hero-grain {
    z-index: 2;
    opacity: .28;
    background-image:
        linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.23) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: linear-gradient(90deg, black 0%, black 45%, transparent 78%);
}

.zf-hero-glow {
    z-index: 3;
    background:
        radial-gradient(circle at 19% 30%, rgba(212,232,138,.34), transparent 23%),
        radial-gradient(circle at 78% 16%, rgba(198,160,106,.42), transparent 24%),
        radial-gradient(circle at 88% 86%, rgba(16,59,45,.34), transparent 34%);
    mix-blend-mode: soft-light;
}

/* Bottom fog belongs to the hero stacking context, below copy and buttons. */
.front-home-sections .zf-hero-sticky::after {
    content: "";
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: -1px;
    left: 0;
    height: clamp(120px, 22vh, 260px);
    pointer-events: none;
    background: linear-gradient(180deg, rgba(247,240,226,0) 0%, rgba(247,240,226,.42) 52%, rgba(247,240,226,.94) 100%);
}

.zf-hero-content {
    position: relative;
    z-index: 10;
    width: min(920px, calc(100vw - 40px));
    height: 100%;
    padding: 0 0 0 clamp(56px, 10.5vw, 190px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    transform:
        translateY(calc(18px - (var(--zf-progress) * 24px)))
        scale(calc(1 - (var(--zf-progress) * .015)));
    opacity: calc(1 - (var(--zf-progress) * .06));
}

.zf-hero-content::before { display: none; }

.zf-hero-content h1 {
    max-width: 1040px;
    margin: 0 0 28px;
    color: var(--zf-forest);
    font-family: var(--zf-font-display);
    font-size: clamp(58px, 6.9vw, 118px);
    line-height: .92;
    letter-spacing: -.058em;
    font-weight: 600;
    text-wrap: balance;
    will-change: transform, opacity, filter;
    transform-origin: left center;
}

.zf-hero-content p {
    max-width: 660px;
    margin: 0;
    padding-left: 18px;
    border-left: 2px solid rgba(198, 160, 106, .72);
    color: rgba(23,35,27,.80);
    font-family: var(--zf-font);
    font-size: clamp(19px, 1.72vw, 26px);
    line-height: 1.46;
    letter-spacing: -.012em;
    font-weight: 520;
    text-wrap: balance;
    will-change: transform, opacity, filter;
}

.zf-hero-actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 32px;
    transform: translateY(-24px);
    transform-origin: left center;
    opacity: 1;
    filter: none;
    will-change: transform, opacity;
}

.zf-hero-actions::before {
    content: none;
    display: none;
}

.zf-btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    padding: 0 32px;
    overflow: hidden;
    border-radius: var(--zf-radius-pill);
    text-decoration: none;
    font-family: var(--zf-font);
    font-size: 15.5px;
    font-weight: 780;
    letter-spacing: -.004em;
    opacity: 1;
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease, color .22s ease;
    will-change: transform;
}

.zf-btn::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: -1;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(255,255,255,.52), rgba(255,255,255,.14) 32%, rgba(255,255,255,0) 68%),
        radial-gradient(circle at 24% 12%, rgba(255,255,255,.70), transparent 25%);
    opacity: .18;
    pointer-events: none;
}

.zf-btn::after {
    content: "→";
    margin-left: 13px;
    font-weight: 600;
    opacity: .72;
    transform: translateX(0);
    transition: transform .22s ease, opacity .22s ease;
}

.zf-btn:hover { transform: translateY(-2px); }
.zf-btn:hover::after { transform: translateX(4px); }

.zf-btn-primary {
    border: 1px solid var(--zf-forest);
    background: var(--zf-forest);
    color: #fffaf0;
    box-shadow: 0 18px 44px rgba(16, 59, 45, .34);
}

.zf-btn-ghost {
    border: 1px solid rgba(16, 59, 45, .62);
    background: #fffaf0;
    color: var(--zf-forest);
    box-shadow: 0 18px 42px rgba(16, 59, 45, .18);
}

.zf-btn.is-disabled {
    cursor: default;
    pointer-events: none;
    opacity: .88;
}

.zf-btn.is-disabled::after { opacity: .35; }
.zf-btn.is-disabled:hover { transform: none; }

.zf-scroll-mark {
    position: absolute;
    z-index: 12;
    left: 50%;
    right: auto;
    bottom: clamp(18px, 3vw, 34px);
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(16, 59, 45, .98);
    border-radius: 50%;
    background: rgba(16, 59, 45, .92);
    box-shadow: 0 12px 30px rgba(16, 59, 45, .24);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transform: translateX(-50%);
    opacity: calc(.78 - (var(--zf-progress) * .55));
}

.zf-scroll-mark span {
    position: relative;
    width: 22px;
    height: 32px;
    border: 1px solid rgba(255, 249, 236, .9);
    border-radius: 999px;
}

.zf-scroll-mark span::after {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: rgba(255, 249, 236, .96);
    animation: zf-wheel 1.55s ease-in-out infinite;
}

@keyframes zf-wheel {
    0% { transform: translateY(0); opacity: .10; }
    30% { opacity: .9; }
    100% { transform: translateY(12px); opacity: .05; }
}

.zf-hero-loader {
    position: absolute;
    z-index: 13;
    left: clamp(20px, 7vw, 108px);
    bottom: clamp(26px, 5vh, 58px);
    display: inline-grid;
    grid-template-columns: auto minmax(92px, 132px) auto;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 9px 13px 9px 15px;
    border: 1px solid rgba(255,255,255,.46);
    border-radius: var(--zf-radius-pill);
    background:
        linear-gradient(135deg, rgba(255,255,255,.36), rgba(255,250,238,.16)),
        rgba(255,250,238,.22);
    color: rgba(16,59,45,.84);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    backdrop-filter: blur(22px) saturate(1.35);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.52),
        0 18px 48px rgba(33,48,32,.10);
    font-size: 13px;
    font-weight: 720;
    letter-spacing: -.012em;
    opacity: 1;
    transform: translateY(0);
    transition: opacity .36s ease, transform .36s ease, visibility .36s ease;
    pointer-events: none;
}

.zf-scroll-hero.is-sequence-ready .zf-hero-loader {
    opacity: 0;
    transform: translateY(8px);
    visibility: hidden;
}

.zf-hero-loader-bar {
    position: relative;
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16,59,45,.16);
}

.zf-hero-loader-bar i {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(16,59,45,.82), rgba(101,122,73,.86), rgba(212,232,138,.88));
    transition: width .18s ease;
}

.zf-hero-loader-count {
    min-width: 34px;
    text-align: right;
    color: rgba(16,59,45,.70);
}

.zf-scroll-hero:not(.is-sequence-ready) .zf-scroll-mark { opacity: .18; }
.zf-scroll-hero:not(.is-sequence-ready) .zf-hero-content { pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
    .zf-hero-sequence,
    .zf-hero-content,
    .zf-btn,
    .zf-btn::after {
        transition: none;
        transform: none;
    }

    .zf-scroll-mark span::after { animation: none; }
}

@media (max-width: 980px) {
    .zf-scroll-hero,
    .zf-hero-sticky {
        height: 100svh;
        min-height: 100svh;
    }

    .zf-hero-sequence {
        inset: 0;
        width: 100%;
        height: 100%;
        object-position: 60% center;
        transform: scale(calc(1.025 - (var(--zf-progress) * .004)));
    }

    .zf-hero-content {
        width: 100%;
        height: 100%;
        padding: clamp(86px, 13.5vh, 118px) 18px calc(96px + env(safe-area-inset-bottom));
        justify-content: flex-start;
        align-items: flex-start;
        transform: none;
    }

    .zf-hero-wash {
        background:
            linear-gradient(180deg,
                rgba(247,240,226,.82) 0%,
                rgba(247,240,226,.62) 28%,
                rgba(247,240,226,.22) 52%,
                rgba(16,59,45,.08) 100%),
            linear-gradient(90deg,
                rgba(247,240,226,.70) 0%,
                rgba(247,240,226,.26) 54%,
                rgba(247,240,226,.10) 100%);
    }

    .zf-hero-grain {
        mask-image: linear-gradient(180deg, black 0%, black 40%, transparent 100%);
        opacity: .12;
    }

    .zf-hero-content h1 {
        width: min(100%, 390px);
        max-width: 390px;
        margin: 0 0 14px;
        font-size: clamp(34px, 9.4vw, 49px);
        letter-spacing: -.048em;
        line-height: .98;
    }

    .zf-hero-content p {
        max-width: 340px;
        padding-left: 13px;
        font-size: clamp(14px, 3.8vw, 16px);
        line-height: 1.38;
        color: rgba(23,35,27,.76);
        border-left-color: rgba(198,160,106,.62);
    }

    .zf-hero-actions {
        position: absolute;
        left: 18px;
        right: 18px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        width: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 9px;
        margin: 0;
        transform-origin: center bottom;
    }

    .zf-btn {
        width: auto;
        min-height: clamp(46px, 7.2vh, 52px);
        padding: 0 10px;
        font-size: clamp(11.5px, 3.25vw, 13px);
        white-space: nowrap;
    }

    .zf-btn::after { margin-left: 7px; }
    .zf-scroll-mark { display: none; }

    .zf-hero-loader {
        left: 18px;
        right: 18px;
        bottom: 18px;
        grid-template-columns: 1fr minmax(72px, 110px) auto;
        width: auto;
        font-size: 12px;
    }
}

@media (max-width: 980px) and (max-height: 700px) {
    .zf-hero-content { padding-top: 78px; }

    .zf-hero-content h1 {
        max-width: 390px;
        margin-bottom: 10px;
        font-size: clamp(30px, 8vw, 42px);
    }

    .zf-hero-content p {
        max-width: 330px;
        font-size: 13.5px;
        line-height: 1.32;
    }

    .zf-btn {
        min-height: 42px;
        font-size: 11.5px;
    }
}

@media (max-width: 760px) {
    .zf-hero-content {
        padding-top: clamp(112px, 18vh, 150px);
        padding-bottom: 104px;
    }

    .zf-hero-actions {
        bottom: calc(68px + env(safe-area-inset-bottom));
        transform: none;
    }
}

@media (max-width: 620px) {
    .zf-hero-actions {
        left: 14px;
        right: 14px;
    }
}

@media (max-width: 380px) {
    .zf-hero-content h1 {
        max-width: 330px;
        font-size: clamp(31px, 8.8vw, 40px);
    }

    .zf-hero-content p {
        max-width: 300px;
        font-size: 13.5px;
    }

    .zf-btn {
        min-height: 44px;
        padding: 0 7px;
        font-size: 11.5px;
    }
}

@media (max-width: 760px) and (max-height: 700px) {
    .zf-hero-content {
        padding-top: 96px;
        padding-bottom: 86px;
    }

    .zf-hero-actions { bottom: calc(52px + env(safe-area-inset-bottom)); }
}

/* Wide-screen hero copy layout belongs here, not to the later home UI layer. */
@media (min-width: 901px) {
    .front-home .zf-hero-content {
        width: min(944px, calc(100vw - 80px));
        margin-right: 0;
        margin-left: max(40px, calc(var(--zf-home-shell-gutter) - 300px));
        padding-left: 0;
        transform-origin: left center;
    }
}

/* Agent account entry belongs to the primary buy action on the hero. */
.zf-hero-buy-action {
    position: relative;
    display: inline-flex;
}

.zf-hero-buy-action > .zf-btn { width: 100%; }

.zf-agent-signup-link {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    color: rgba(16,59,45,.76);
    font-family: var(--zf-font);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.25;
    text-align: center;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color .18s ease;
}

.zf-agent-signup-link:hover { color: var(--zf-forest); }

@media (max-width: 980px) {
    .zf-hero-buy-action {
        display: grid;
        gap: 5px;
    }

    .zf-agent-signup-link {
        position: static;
        padding: 0 2px;
        font-size: 10.5px;
    }

    .zf-hero-actions > .zf-btn-ghost { align-self: start; }
}
