/* Hero 'phone' (sections/hero.php): the photo covers the hero, the copy on the 1289 grid, the phone with the app QR
   beside it; phones get the landing's own 390px composition, the copy under the photo. Loaded before the benefit
   landings' hero.css, so every rule is one class stronger than the one it replaces there. */

/* desktop: the design's 1710 x 791 (a longer copy grows it, 48px under the button) */
@media (min-width: 1024px) {
    .sales-page.ltb-page .ltb-hero.sales-hero--phone {
        --ltb-shift: 0px;
        height: auto;
        min-height: 791px;
        background: var(--ltb-carbon);
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__media {
        inset: 0;
        width: auto;
        min-height: 0;
        aspect-ratio: auto;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__img {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__inner {
        width: min(1289px, 100% - 48px);
        max-width: none;
        margin: 0 0 0 max(24px, 50% - 646px);
        padding: 0;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__copy {
        width: 710px;
        max-width: 100%;
        margin-left: 0;
        padding: 191px 0 48px;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__title {
        width: 100%;
        margin-top: 0;
        font-size: 60px;
        font-weight: 900;
        line-height: 59px;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__desc {
        width: var(--sales-desc-w, 384px);
        max-width: 100%;
        margin-top: 55px;
        font-size: 24px;
        font-weight: 700;
        line-height: 32px;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__row {
        gap: 0;
        margin-top: 50px;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__lead {
        width: auto;
        max-width: 100%;
    }
}

@supports (text-box: trim-both cap alphabetic) {
    @media (min-width: 1024px) {
        .sales-page.ltb-page .ltb-hero.sales-hero--phone :is(.ltb-hero__title, .ltb-hero__desc) {
            text-box: trim-both cap alphabetic;
        }
    }
}

/* the green 56px pill without an arrow (button / primary / large) */
.sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__btn {
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: 56px;
    margin-top: 0;
    padding: 8px 32px;
    border-radius: 28px;
    background: var(--ltb-green-muted);
    color: var(--ltb-carbon);
    font-size: 16px;
    font-weight: 800;
    line-height: 24px;
    letter-spacing: 0;
    text-align: center;
    /* the design's case (the site's app links are uppercase with !important) */
    text-transform: none !important;
    white-space: normal;
}

.sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__btn .ltb-btn__icon {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__btn:hover {
        background: #000;
        color: var(--ltb-green);
    }
}

/* the phone: 356 x 708 (cut by the hero's bottom), a 5px carbon frame inside and a 4px green one outside, the two
   green keys on its left; from 1200px up, where it stays clear of the copy */
.sales-phone {
    display: none;
}

@media (min-width: 1200px) {
    .sales-phone {
        position: absolute;
        top: 430.9px;
        right: 4px;
        z-index: 2;
        display: block;
        width: 356px;
        height: 708.06px;
    }
}

.sales-phone__key {
    position: absolute;
    left: -9px;
    width: 35px;
    height: 48.55px;
    border-radius: 3px;
    background: var(--ltb-green-muted);
}

.sales-phone__key--1 {
    top: 170.95px;
}

.sales-phone__key--2 {
    top: 223.55px;
}

.sales-phone__body {
    position: absolute;
    inset: 0;
    z-index: 1;
    box-sizing: border-box;
    border: 5px solid var(--ltb-carbon);
    border-radius: 59px;
    background: #fff;
    box-shadow: 0 0 0 4px var(--ltb-green-muted);
}

.sales-phone__bar {
    position: absolute;
    top: 9.16px;
    left: 12px;
    display: block;
    width: 318px;
    height: 48.66px;
}

/* the generated code has no quiet zone: the design's 165.58px code */
.sales-phone__qr {
    position: absolute;
    top: 67.99px;
    left: 86.89px;
    display: block;
    width: 165.58px;
    height: 165.58px;
    opacity: 0;
    transition: opacity .3s ease;
}

.sales-phone__qr.is-ready {
    opacity: 1;
}

.sales-page .sales-phone__text {
    position: absolute;
    top: 266.1px;
    left: 45px;
    width: 250px;
    margin: 0;
    color: #000;
    font-family: Nunito, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 22.4px;
    text-align: center;
}

@supports (text-box: trim-both cap alphabetic) {
    .sales-page .sales-phone__text {
        text-box: trim-both cap alphabetic;
    }
}

.sales-page .sales-phone__text strong {
    font-weight: 700;
}

.sales-page .sales-phone__text .green {
    color: var(--ltb-green-muted);
}

.sales-page .sales-phone__text u {
    text-decoration-thickness: from-font;
    text-underline-position: from-font;
}

/* the ZEN cards around it (centre, size, rotation, blur from the config); over the phone, as in the design */
.sales-phone__card {
    position: absolute;
    top: calc(var(--y) - var(--h) / 2);
    left: calc(var(--x) - var(--w) / 2);
    z-index: 2;
    display: block;
    width: var(--w);
    max-width: none;
    height: var(--h);
    transform: rotate(var(--r));
    filter: blur(var(--b));
    pointer-events: none;
}

/* the entrance: each card slides out to its place along the line from the green ribbon's ring (config phone 'from',
   sales_card_flight()) - out of the ring, or from behind the phone (under it until it is clear) - turning a little
   and growing, easing out, one after another */
@media (prefers-reduced-motion: no-preference) {
    .sales-phone__card[style*="--fx"] {
        animation: sales-card-fly 1.1s cubic-bezier(.16, 1, .3, 1) calc(.5s + var(--i, 0) * .14s) both;
    }
}

@keyframes sales-card-fly {
    0% {
        z-index: 0;
        opacity: 0;
        translate: var(--fx) var(--fy);
        scale: .7;
        rotate: -24deg;
    }

    35% {
        z-index: 0;
        opacity: 1;
    }

    36%,
    100% {
        z-index: 2;
        opacity: 1;
    }

    100% {
        translate: 0 0;
        scale: 1;
        rotate: 0deg;
    }
}

/* the progressive blur's blurred copy: a box --pad larger all round (room for the halo), masked along the blur */
.sales-phone__card--fade {
    top: calc(var(--y) - var(--h) / 2 - var(--pad));
    left: calc(var(--x) - var(--w) / 2 - var(--pad));
    width: calc(var(--w) + 2 * var(--pad));
    height: calc(var(--h) + 2 * var(--pad));
    filter: none;
    -webkit-mask-image: var(--m);
    mask-image: var(--m);
}

.sales-phone__card--fade img {
    position: absolute;
    top: var(--pad);
    left: var(--pad);
    display: block;
    width: var(--w);
    max-width: none;
    height: var(--h);
}

/* phones and tablets: the landing's 390px composition (its photo, the ribbon and the shades baked in, as wide as the
   photo so wider screens show more of it), scaled with one unit up to 520px and centred past it; the copy 410
   units down, 20 in, the button the column's width. The unit also keeps the button on the first screen (its bottom,
   719 units down, 24px above the screen's bottom with the browser's bars shown): on a shorter screen the whole
   composition is a little smaller, the photo's sides fill the room beside it */
@media (max-width: 1023px) {
    .sales-page.ltb-page .ltb-hero.sales-hero--phone {
        --u: calc(min(100vw, 520px, (100svh - 24px) * 390 / 719) / 390);
        --ltb-l: max(0px, (100vw - 390 * var(--u)) / 2);
        height: auto;
        min-height: 0;
        background: #000;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__img {
        top: calc(var(--sales-m-top, 0) * var(--u));
        bottom: auto;
        left: calc(var(--ltb-l) + var(--sales-m-left, 0) * var(--u));
        width: calc(var(--sales-m-w, 390) * var(--u));
        height: calc(var(--sales-m-h, 859) * var(--u));
        object-fit: fill;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__inner {
        height: auto;
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__copy {
        width: calc(350 * var(--u));
        height: auto;
        min-height: 0;
        margin-left: calc(var(--ltb-l) + 20 * var(--u));
        padding: calc(410 * var(--u)) 0 calc(40 * var(--u));
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__title {
        width: 100%;
        max-width: none;
        margin-top: 0;
        font-size: calc(36 * var(--u));
        font-weight: 900;
        line-height: calc(36 * var(--u));
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__desc {
        max-width: none;
        margin-top: calc(27 * var(--u));
        font-size: calc(16 * var(--u));
        font-weight: 700;
        line-height: calc(24 * var(--u));
    }

    .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__btn {
        width: 100%;
        min-height: calc(56 * var(--u));
        margin-top: calc(47 * var(--u));
        margin-bottom: 0;
        padding: calc(8 * var(--u)) calc(24 * var(--u));
        border-radius: calc(28 * var(--u));
        font-size: calc(16 * var(--u));
        line-height: calc(20 * var(--u));
    }
}

@supports (text-box: trim-both cap alphabetic) {
    @media (max-width: 1023px) {
        .sales-page.ltb-page .ltb-hero.sales-hero--phone .ltb-hero__desc {
            text-box: trim-both cap alphabetic;
        }
    }
}
