/* ==========================================================================
   gday home: the home page (routes/index.cfc)
   ==========================================================================
   An area file: loaded after core.css by the pages that pass
   styles="home" to their layout. Served as written (core.css explains the
   system, its layers and breakpoints). Everything here is in re-components.
   ========================================================================== */

@layer re-components {

/* ==========================================================================
   Home page (routes/index.cfc)
   ==========================================================================
   The launch facelift's home page: the photo hero with the address search,
   How Real Easy works (a phone beside three steps), the brand line on
   near-black, the guide tiles, the questions on the grey fill. Bands are
   separated by space and fill alone.

     .re-hero               the hero: photo, shade, the screen layer, the words
     .re-home-band          a band of the page; --fill puts it on the grey fill
     .re-home-how           How Real Easy works
     .re-phone              a phone showing one of the product's screens
     .re-home-brand         the brand line
     .re-guide-links        the guide tiles
     .re-faq                the questions
   ========================================================================== */

/* ---- Hero ---------------------------------------------------------------- */

/* The photo fills the hero's height from its right edge, fading in from the
   left; the shade over it is solid behind the words and clear by the phone.
   On a phone the photo sits below the words instead, so the product's screen
   is never behind them. */
.re-hero {
    position: relative;
    overflow: hidden;
    padding-block: var(--re-space-96);
    background: var(--re-color-hero-ground);
    color: var(--re-color-text-inverse);

    @media (width <= 37.5rem) {
        padding-block: var(--re-space-56) calc(29.375rem + var(--re-space-72));
    }
}

.re-hero-photo,
.re-hero-shade,
.re-hero-screen {
    position: absolute;
    inset: 0;

    @media (width <= 37.5rem) {
        top: auto;
        height: 29.375rem;
    }
}

.re-hero-photo {
    -webkit-mask-image: linear-gradient(90deg, transparent 4%, var(--re-color-text) 58%);
    mask-image: linear-gradient(90deg, transparent 4%, var(--re-color-text) 58%);

    & img {
        position: absolute;
        top: 0;
        right: 0;
        width: auto;
        max-width: none;
        height: 100%;
    }

    /* Between a phone and a desktop the phone in the photo moves in from the edge. */
    @media (37.5rem < width <= 61.25rem) {
        & img {
            right: auto;
            left: 88%;
            transform: translateX(-88%);
        }
    }

    @media (width <= 37.5rem) {
        -webkit-mask-image: linear-gradient(180deg, transparent 0, var(--re-color-text) 10%);
        mask-image: linear-gradient(180deg, transparent 0, var(--re-color-text) 10%);

        & img {
            right: auto;
            left: 83%;
            transform: translateX(-83%);
        }
    }
}

.re-hero-shade {
    z-index: 1;
    background: linear-gradient(
        100deg,
        color-mix(in srgb, var(--re-color-hero-ink) 82%, transparent) 0%,
        color-mix(in srgb, var(--re-color-hero-ink) 40%, transparent) 52%,
        color-mix(in srgb, var(--re-color-hero-ink) 6%, transparent) 100%
    );

    @media (width <= 37.5rem) {
        background: color-mix(in srgb, var(--re-color-hero-ink) 30%, transparent);
    }
}

/* The screen of the phone in the photo, above the shade so it stays bright:
   390 x 870, set into the photo's glass by the page's script, which marks it
   fitted. Between a phone and a desktop the words can overlap the phone, so
   the layer is hidden and the photo's own screen shows, under the shade. */
.re-hero-screen {
    z-index: 1;

    @media (37.5rem < width <= 61.25rem) {
        display: none;
    }
}

.re-hero-glass {
    position: absolute;
    top: 0;
    left: 0;
    width: 390px;
    height: 870px;
    overflow: hidden;
    border-radius: var(--re-radius-phone-glass);
    background: var(--re-color-action);
    clip-path: inset(0.5px round 44px);
    opacity: 0;
    transform-origin: 0 0;

    &.is-fitted {
        opacity: 1;
    }

    & img {
        display: block;
        width: 100%;
        height: 100%;
    }

    &::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: linear-gradient(112deg, var(--re-color-glass-sheen) 0%, transparent 48%);
        box-shadow: var(--re-shadow-phone-glass);
        pointer-events: none;
    }
}

.re-hero-wrap {
    position: relative;
    z-index: 2;
}

.re-hero-inner {
    max-width: 40rem;
}

.re-hero-search {
    max-width: 27.5rem;
}

/* Returning sellers: a way back to the property they were on. */
.re-hero-return {
    max-width: 27.5rem;
    margin-top: var(--re-space-28);
}

.re-hero-return-label {
    margin: 0 0 var(--re-space-10);
    font-size: var(--re-text-caption);
    font-weight: var(--re-weight-semibold);
    color: var(--re-color-text-inverse-muted);
}

.re-hero-return-card {
    display: flex;
    align-items: center;
    gap: var(--re-space-14);
    padding: var(--re-space-12) var(--re-space-12) var(--re-space-12) var(--re-space-16);
    border-radius: var(--re-radius-lg);
    background: var(--re-color-photo-card);
    outline: 1px solid transparent;
    transition: background-color var(--re-duration-fast) ease;

    @media (hover: hover) and (pointer: fine) {
        &:hover {
            background: var(--re-color-photo-card-hover);
        }
    }
}

.re-hero-return-pin {
    flex: none;
    font-size: var(--re-text-h3);
    color: var(--re-color-action);
}

.re-hero-return-text {
    flex: 1;
    min-width: 0;

    & span {
        display: block;
        font-size: var(--re-text-caption);
        color: var(--re-color-text-inverse-muted);
    }

    & b {
        display: block;
        font-size: var(--re-text-body);
        font-weight: var(--re-weight-semibold);
        line-height: var(--re-leading-snug);
    }
}

.re-hero-return-go {
    display: grid;
    place-items: center;
    flex: none;
    width: var(--re-size-tap);
    height: var(--re-size-tap);
    border-radius: var(--re-radius-round);
    background: var(--re-color-action);
    color: var(--re-color-on-action);
    font-size: var(--re-text-small);
}

.re-hero-return-all {
    display: inline-flex;
    align-items: center;
    gap: var(--re-space-6);
    min-height: var(--re-size-tap);
    margin-top: var(--re-space-4);
    font-size: var(--re-text-small);
    font-weight: var(--re-weight-semibold);
    color: var(--re-color-text-inverse-muted);

    @media (hover: hover) and (pointer: fine) {
        &:hover {
            color: var(--re-color-text-inverse);
        }
    }

    & > i {
        font-size: var(--re-text-caption);
    }
}

/* ---- Bands ----------------------------------------------------------------- */

/* A band of the page: 96px above and below (56px on a phone). Two white bands
   in a row share the space between them. */
.re-home-band {
    padding-block: var(--re-space-96);

    & .re-h2 {
        line-height: 1.15;
    }

    @media (width <= 37.5rem) {
        padding-block: var(--re-space-56);
    }
}

.re-home-band--fill {
    background: var(--re-color-fill);
}

.re-home-band:not(.re-home-band--fill) + .re-home-band:not(.re-home-band--fill) {
    padding-top: 0;
}

/* The grey line under a band's heading. */
.re-home-lead {
    max-width: 40rem;
    margin: var(--re-space-12) 0 var(--re-space-32);
    font-size: var(--re-text-body);
    line-height: var(--re-leading-body);
    color: var(--re-color-text-muted);
    text-wrap: pretty;
}

/* ---- How Real Easy works ----------------------------------------------------- */

/* The phone on the left, turned towards the heading and steps on the right;
   stacked from the header's compact width down: heading, phone, steps. */
.re-home-how {
    overflow-x: clip;

    @media (width > 52.5rem) {
        padding-bottom: calc(var(--re-space-96) + var(--re-space-64));
    }
}

.re-home-how-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "phone head"
        "phone steps";
    column-gap: var(--re-space-56);
    align-items: center;

    @media (width <= 52.5rem) {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "head"
            "phone"
            "steps";
    }
}

.re-home-how-title {
    grid-area: head;
    align-self: end;
    margin: 0 0 var(--re-space-40);
    font-family: var(--re-font-display);
    font-size: var(--re-text-display);
    font-weight: var(--re-weight-bold);
    line-height: 1.05;
    letter-spacing: var(--re-tracking-display);
    text-wrap: balance;

    @media (width <= 52.5rem) {
        margin-bottom: var(--re-space-24);
    }
}

.re-home-how-phone {
    --re-phone-height: min(66vh, 38.75rem);

    grid-area: phone;
    display: flex;
    justify-content: center;
    padding-block: var(--re-space-40);

    @media (width <= 52.5rem) {
        --re-phone-height: min(62svh, 35rem);

        margin-bottom: var(--re-space-32);
    }
}

.re-home-how-text {
    grid-area: steps;
    align-self: start;
}

.re-home-steps {
    display: grid;
    gap: var(--re-space-32);
    margin-bottom: var(--re-space-32);

    & h3 {
        margin: 0 0 var(--re-space-8);
        font-family: var(--re-font-display);
        font-size: var(--re-text-h2);
        font-weight: var(--re-weight-bold);
        line-height: 1.15;
        letter-spacing: var(--re-tracking-display);
        text-wrap: balance;
    }

    & p {
        max-width: 40ch;
        margin: 0;
        font-size: var(--re-text-lede);
        line-height: var(--re-leading-body);
        color: var(--re-color-text-soft);
        text-wrap: pretty;
    }
}

.re-home-step-number {
    color: var(--re-color-action);
}

/* A pink link with an arrow, out to the page that tells the rest. */
.re-home-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: var(--re-space-6);
    min-height: var(--re-size-tap);
    font-size: var(--re-text-body);
    font-weight: var(--re-weight-semibold);
    line-height: var(--re-leading-title);
    color: var(--re-color-action);

    & > i {
        font-size: var(--re-text-small);
    }

    @media (hover: hover) and (pointer: fine) {
        &:hover {
            -webkit-text-decoration: underline;
            text-decoration: underline;
            text-underline-offset: 3px;
        }
    }
}

/* ---- Phone --------------------------------------------------------------- */

/* A phone showing one of the product's screens (390 x 870), turned a little
   and lit from the upper left. Its height comes from --re-phone-height, set
   where it stands. */
.re-phone {
    position: relative;
    height: var(--re-phone-height);
    aspect-ratio: 300 / 640;
    padding: var(--re-space-12);
    border-radius: var(--re-radius-phone);
    background: var(--re-color-secondary);
    box-shadow: var(--re-shadow-phone);
    transform: perspective(1600px) rotateY(10deg) rotateX(4deg);

    /* The speaker. */
    &::before {
        content: "";
        position: absolute;
        top: 4px;
        left: 50%;
        z-index: 2;
        width: 22%;
        height: 4px;
        border-radius: var(--re-radius-pill);
        background: var(--re-color-phone-speaker);
        transform: translateX(-50%);
    }

    /* Light across the glass. */
    &::after {
        content: "";
        position: absolute;
        inset: var(--re-space-12);
        z-index: 2;
        border-radius: var(--re-radius-phone-screen);
        background: linear-gradient(115deg, var(--re-color-glass-sheen) 0%, transparent 38%);
        pointer-events: none;
    }
}

.re-phone-screen {
    position: absolute;
    inset: var(--re-space-12);
    overflow: hidden;
    border-radius: var(--re-radius-phone-screen);
    background: var(--re-color-secondary);
    backface-visibility: hidden;

    /* A pixel past the screen's edge, so the body never shows through at it. */
    & img {
        position: absolute;
        inset: -1px;
        width: calc(100% + 2px);
        max-width: none;
        height: calc(100% + 2px);
        object-fit: cover;
        object-position: 50% 0;
    }
}

/* ---- The brand line -------------------------------------------------------- */

.re-home-brand {
    display: flex;
    align-items: center;
    min-height: 35rem;
    padding-block: var(--re-space-96);
    background: var(--re-color-brand-ink);
    color: var(--re-color-text-inverse);

    @media (width <= 37.5rem) {
        min-height: 0;
        padding-block: calc(var(--re-space-80) + var(--re-space-8));
    }
}

.re-home-brand-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22.5rem;
    column-gap: var(--re-space-56);
    align-items: center;

    @media (width <= 52.5rem) {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* The line is sized by this column's width (--re-text-brand-line). */
.re-home-brand-text {
    container-type: inline-size;
    min-width: 0;
}

.re-home-brand-line {
    margin: 0 0 var(--re-space-24);
    font-family: var(--re-font-display);
    font-size: var(--re-text-brand-line);
    font-weight: var(--re-weight-bold);
    line-height: var(--re-leading-none);
    letter-spacing: -0.035em;

    & span {
        display: block;
        white-space: nowrap;
    }

    & em {
        font-style: normal;
        color: var(--re-color-action);
    }

    @media (width <= 37.5rem) {
        margin-bottom: var(--re-space-16);
        line-height: 1.05;
    }
}

.re-home-brand-sub {
    max-width: 40ch;
    margin: 0;
    font-size: var(--re-text-h3);
    line-height: var(--re-leading-body);
    color: var(--re-color-on-brand-ink-muted);
    text-wrap: pretty;

    @media (width <= 37.5rem) {
        font-size: var(--re-text-lede);
    }
}

.re-home-brand-wordmark {
    width: 100%;
    height: auto;

    @media (width <= 52.5rem) {
        width: 10rem;
        margin-top: var(--re-space-40);
    }

    @media (width <= 37.5rem) {
        margin-top: var(--re-space-32);
    }
}

/* ---- Guide tiles ------------------------------------------------------------- */

.re-guide-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--re-space-12);

    @media (width <= 52.5rem) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (width <= 37.5rem) {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--re-space-8);
    }
}

.re-guide-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--re-space-12);
    min-height: var(--re-space-72);
    padding: var(--re-space-16) var(--re-space-24);
    border-radius: var(--re-radius-md);
    background: var(--re-color-fill);
    font-size: var(--re-text-body);
    font-weight: var(--re-weight-semibold);
    line-height: 1.35;
    outline: 1px solid transparent;
    transition: background-color var(--re-duration-fast) ease;

    & > i {
        flex: none;
        color: var(--re-color-action);
    }

    @media (hover: hover) and (pointer: fine) {
        &:hover {
            background: var(--re-color-action-tint);
        }
    }

    @media (width <= 37.5rem) {
        min-height: var(--re-size-control);
    }
}

/* ---- Questions --------------------------------------------------------------- */

/* Each question a white card on the fill that folds its answer (a <details>),
   a pink plus at its end, a minus while open. */
.re-faq {
    max-width: 47.5rem;
    margin-top: var(--re-space-32);
}

.re-faq-item {
    margin-bottom: var(--re-space-12);
    overflow: hidden;
    border-radius: var(--re-radius-md);
    background: var(--re-color-surface);
    outline: 1px solid transparent;

    & summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--re-space-12);
        min-height: var(--re-size-control);
        padding: var(--re-space-16) var(--re-space-24);
        font-size: var(--re-text-body);
        font-weight: var(--re-weight-semibold);
        line-height: 1.4;
        cursor: pointer;
    }

    & summary::-webkit-details-marker {
        display: none;
    }

    & summary:focus-visible {
        outline-offset: -2px;
        border-radius: var(--re-radius-md);
    }

    & p {
        margin: 0;
        padding: 0 var(--re-space-24) var(--re-space-16);
        font-size: var(--re-text-body);
        line-height: 1.6;
        color: var(--re-color-text-muted);
        text-wrap: pretty;
    }
}

/* The plus, and the minus that takes its place while the answer is open. Each
   is shown and hidden through its wrapper, never on the icon itself (Font
   Awesome's stylesheet is unlayered). */
.re-faq-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: var(--re-space-20);
    height: var(--re-space-20);
    color: var(--re-color-action);
}

.re-faq-mark--open,
.re-faq-item[open] .re-faq-mark:not(.re-faq-mark--open) {
    display: none;
}

.re-faq-item[open] .re-faq-mark--open {
    display: grid;
}

}
