/*
    The homepage's own sections. Linked after site.css, which holds the tokens, the font and the
    shared chrome. Used by the homepage only.
*/

.eyebrow {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-text);
}

.eyebrow--light {
    color: var(--gold);
}

.textlink {
    font-weight: 700;
    text-underline-offset: 4px;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--navy);
    color: #fff;
}

.hero-art {
    position: absolute;
    inset: 0;
}

/* Each family fades in over 1.6s; only the one with "on" shows. */
.hero-art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: 70% center;
    opacity: 0;
    transition: opacity 1.6s ease-in-out;
}

.hero-art img.on {
    opacity: 1;
}

/*
    A picture that fails to load must never show the browser's broken-image mark, even with
    scripts off. An <img>'s ::after renders only when the image has failed, so this covers the
    mark with the hero's navy.
*/
.hero-art img {
    color: transparent;
}

.hero-art img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--navy);
}

@media (prefers-reduced-motion: reduce) {
    .hero-art img {
        transition: none;
    }
}

/* The left-to-right navy fade that keeps the white headline readable over the art. */
.hero-art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 28, 63, .96) 0%, rgba(15, 28, 63, .88) 34%, rgba(15, 28, 63, .25) 62%, rgba(15, 28, 63, 0) 80%);
}

.hero .wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 640px;
    padding: 64px 0 88px;
}

.hero-copy {
    max-width: 540px;
}

.hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(48px, 6vw, 76px);
    font-weight: 800;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.hero .promise {
    margin: 28px 0 8px;
    font-size: 26px;
    font-weight: 700;
    color: var(--cream);
}

.hero .sub {
    margin: 0 0 32px;
    font-size: 19px;
    color: #DCE3F5;
}

/* Only one of the two lines is ever displayed, so only one is ever read. */
.sub-short {
    display: none;
}

.hero .ctas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.hero .ctas .textlink {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #fff;
}

.promo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--cream);
}

.promo::before {
    content: "\2605";
    color: var(--gold);
}

/* Wider than 1024: the hero grows with the window and the picture anchors near its top, so heads stay in. */
@media (min-width: 1025px) {
    .hero .wrap {
        min-height: clamp(640px, 38vw, 880px);
    }

    .hero-art img {
        object-position: 70% 20%;
    }
}

/*
    Wider than 1024 but 700 tall or less (a sideways Fire, a small laptop): the hero fills what is left
    of the first screen under the strip and header (about 140px), with a smaller headline, so Try stays
    on it.
*/
@media (min-width: 1025px) and (max-height: 700px) {
    .hero .wrap {
        min-height: calc(100vh - 140px);
        padding: 32px 0 40px;
    }

    .hero h1 {
        font-size: 56px;
    }

    .hero .promise {
        margin: 18px 0 6px;
    }

    .hero .sub {
        margin: 0 0 20px;
    }
}

/*
    761 to 1024 wide and taller than 720: the phone layout. The picture is a strip above the copy, so
    no text sits on a face. The strip is the whole 2:1 picture when there is room, and shorter on a
    landscape tablet so Try RiseOhana stays on the first screen. min-height: 721px keeps sideways
    phones and short landscape tablets out of these rules; they take the sideways rule below.
*/
@media (min-width: 761px) and (max-width: 1024px) and (min-height: 721px) {
    .hero-art {
        position: relative;
        height: min(50vw, max(260px, 100vh - 470px));
    }

    .hero-art img {
        object-position: 70% 20%;
    }

    .hero-art::after {
        background: linear-gradient(180deg, rgba(15, 28, 63, 0) 70%, rgba(15, 28, 63, 1) 100%);
    }

    .hero .wrap {
        min-height: 0;
        padding: 8px 0 48px;
    }

    .hero-copy {
        max-width: 640px;
    }
}

/*
    A landscape tablet (about 1024 x 768): the strip is too short for the whole 2:1 picture at full
    width, so the whole picture shows at the strip's height on the right, fading into the navy on its
    left, and the copy is tighter so the button still fits on the first screen.
*/
@media (min-width: 761px) and (max-width: 1024px) and (min-height: 721px) and (max-height: 820px) {
    .hero-art img {
        object-fit: contain;
        object-position: right center;
    }

    .hero-art::after {
        background:
            linear-gradient(90deg, rgba(15, 28, 63, 1) 0, rgba(15, 28, 63, 1) calc(100% - min(50vw, max(260px, 100vh - 470px)) * 2),
                rgba(15, 28, 63, 0) calc(100% - min(50vw, max(260px, 100vh - 470px)) * 2 + 140px)),
            linear-gradient(180deg, rgba(15, 28, 63, 0) 85%, rgba(15, 28, 63, 1) 100%);
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero .promise {
        margin: 14px 0 6px;
    }

    .hero .sub {
        margin: 0 0 18px;
    }

    .hero .wrap {
        padding-top: 4px;
    }
}

/* Phones: the art is a 220px strip on top, fading to navy, and the text sits under it. */
@media (max-width: 760px) {
    .hero-art {
        position: relative;
        height: 220px;
    }

    .hero-art img {
        object-position: 85% center;
    }

    .hero-art::after {
        background: linear-gradient(180deg, rgba(15, 28, 63, 0) 55%, rgba(15, 28, 63, 1) 100%);
    }

    .hero .wrap {
        min-height: 0;
        padding: 4px 0 40px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero .promise {
        margin: 14px 0 6px;
        font-size: 22px;
    }

    .hero .sub {
        margin: 0 0 20px;
        font-size: 17px;
    }

    .sub-long {
        display: none;
    }

    .sub-short {
        display: inline;
    }

    .hero .ctas {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        text-align: center;
    }

    .hero .ctas .textlink {
        justify-content: center;
    }

    .promo {
        margin-top: 8px;
    }
}

/*
    Phones held sideways, and landscape tablets 720 tall or less (a sideways Fire HD 8, a 1024 x 600
    tablet): the picture behind the text with a darker fade, the hero filling the rest of the first
    screen, and tight copy, so the headline and Try fit on it. These are wider than the phone
    breakpoint, so they would otherwise get the long two-line description; they take the phone's
    short line instead.
*/
@media (max-height: 500px) and (orientation: landscape),
       (min-width: 761px) and (max-width: 1024px) and (max-height: 720px) and (orientation: landscape) {
    .hero .wrap {
        min-height: calc(100vh - 140px);
        padding: 12px 0 28px;
    }

    /* The picture is too short here for any crop to keep every face whole, so show all of it. */
    .hero-art img {
        object-fit: contain;
        object-position: right center;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero .promise {
        margin: 8px 0 4px;
        font-size: 20px;
    }

    /* It would sit over a face in the photo; the same words are in the page below. */
    .hero .sub {
        display: none;
    }

    .hero-art::after {
        background: linear-gradient(90deg, rgba(15, 28, 63, .97) 0%, rgba(15, 28, 63, .92) 50%, rgba(15, 28, 63, .55) 72%, rgba(15, 28, 63, .15) 100%);
    }
}

/* ---------- Sections ---------- */
.lead {
    max-width: 640px;
    font-size: 20px;
    color: var(--muted);
}

h2 {
    margin: 0;
    font-size: clamp(30px, 3.6vw, 44px);
    font-weight: 800;
    letter-spacing: -.01em;
}

h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

/* ---------- "Your house, your rules" band ---------- */
.rules {
    padding: 104px 0;
    background: var(--cream) url("/site-v3/final-art/app-intro-background.png") center / cover no-repeat;
}

.rules .head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
    margin-bottom: 48px;
}

.rules .head .hani {
    width: 150px;
}

.cards3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    padding: 32px 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 28, 63, .08);
}

.card .pic {
    display: grid;
    place-items: center;
    height: 260px;
    margin: -12px -8px 24px;
    overflow: hidden;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.card .pic img {
    max-height: 100%;
}

.card .pic .phone-shot {
    width: auto;
    height: 240px;
    border: 6px solid var(--ink);
    border-radius: 18px;
}

.card .pic .coin {
    width: 120px;
}

.card .pic .crop {
    width: 90%;
    height: auto;
    max-height: 228px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 28, 63, .10);
}

.card p {
    margin: 10px 0 0;
    color: var(--muted);
}

/* "See the whole story", centred under the three cards. */
.story-link {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.story-link a {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 14px 26px 14px 14px;
    border: 2px solid var(--gold);
    border-radius: 999px;
    background: var(--cream);
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.story-link img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

@media (max-width: 760px) {
    .rules {
        padding: 72px 0;
    }

    .rules .head {
        grid-template-columns: 1fr 84px;
        gap: 12px;
        align-items: start;
        margin-bottom: 28px;
    }

    .rules .head .hani {
        width: 84px;
    }

    .cards3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ---------- For you, for them ---------- */
.sides {
    padding: 104px 0;
    background: #E8F0FF;
}

.sides .head {
    max-width: 720px;
    margin-bottom: 48px;
}

.sides .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.side {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: center;
    padding: 36px;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(15, 28, 63, .08);
}

.side--kid {
    background: var(--cream);
}

.side .tag {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--deep);
}

.side--kid .tag {
    color: var(--gold-text);
}

.side h3 {
    margin: 8px 0 10px;
}

.side p {
    margin: 0;
    font-size: 17px;
    color: var(--muted);
}

.side .phone-shot {
    width: 170px;
    height: auto;
    border: 7px solid var(--ink);
    border-radius: 22px;
}

/* ---------- Our difference, and Min's note ---------- */
.diff {
    padding: 104px 0;
    background: var(--cream-2);
}

.diff h2 {
    margin-bottom: 40px;
}

.diff .grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

.cards4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dcard {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(15, 28, 63, .06);
}

.dcard img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
    object-position: center 15%;
}

.dcard img.fit {
    padding: 12px;
    object-fit: contain;
    background: var(--cream);
}

.dcard img.shot {
    object-position: center top;
    background: #F5F6FA;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
}

.dcard div {
    padding: 20px 22px 24px;
}

.dcard h3 {
    font-size: 19px;
}

.dcard p {
    margin: 8px 0 0;
    font-size: 16px;
    color: var(--muted);
}

.founders {
    position: relative;
    padding: 28px;
    background: #fff;
    border: 2px solid var(--gold);
    border-radius: 20px;
}

.founders p {
    margin: 0 0 14px;
    font-size: 16px;
    color: var(--body);
}

.founders .sig {
    font-weight: 800;
    color: var(--ink);
}

.founders .tip {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
    color: var(--muted);
}

/* Desktop: Min's short note sits centred beside the four cards, a little larger, as a pull quote. */
@media (min-width: 1025px) {
    .diff .founders {
        align-self: center;
        padding: 36px 32px;
    }

    .diff .founders p {
        font-size: 19px;
        line-height: 1.5;
    }

    .diff .founders .sig {
        margin-top: 18px;
        font-size: 18px;
    }
}

/* Tablet and down: one column, Min's note after the grid. */
@media (max-width: 1024px) {
    .sides .grid,
    .diff .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sides,
    .diff {
        padding: 72px 0;
    }

    .sides .grid {
        gap: 20px;
    }

    .side {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 28px 22px;
        text-align: center;
    }

    .side .phone-shot {
        width: 200px;
    }

    .cards4 {
        grid-template-columns: 1fr;
    }

    .dcard img.shot {
        height: 230px;
    }
}

/* ---------- Pricing ---------- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.pricing {
    padding: 104px 0;
    background: #fff;
}

.price-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 40px;
    background: var(--cream-2);
    border: 2px solid var(--line);
    border-radius: 28px;
    text-align: center;
}

.price {
    margin: 20px 0 6px;
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    color: var(--ink);
}

.price small {
    font-size: 22px;
    font-weight: 700;
    color: var(--muted);
}

.price s {
    margin-right: 10px;
    font-size: 28px;
    font-weight: 600;
    color: var(--muted);
}

.price-card ul {
    display: grid;
    gap: 10px;
    margin: 24px 0 32px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.price-card li::before {
    content: "\2713";
    margin-right: 10px;
    font-weight: 800;
    color: #2E7D32;
}

.price-card .trial {
    margin: 14px 0 0;
    font-weight: 700;
    color: var(--gold-text);
}

/* ---------- Closing band ---------- */
.closing {
    position: relative;
    overflow: hidden;
    padding: 96px 0;
    background: var(--navy);
    color: #fff;
    text-align: center;
}

.closing h2 {
    color: #fff;
}

.closing p {
    max-width: 560px;
    margin: 16px auto 32px;
    color: #DCE3F5;
}

.closing .hani {
    width: 130px;
    margin: 0 auto 20px;
}

.closing .signoff {
    margin-top: 28px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--gold);
}

@media (max-width: 760px) {
    .pricing {
        padding: 48px 0;
    }

    .price {
        font-size: 52px;
    }

    .price-card {
        padding: 36px 24px;
    }
}

/* A section focused by a same-page link (tabindex="-1") takes focus without drawing a ring round it. */
section[tabindex="-1"]:focus {
    outline: none;
}

/*
    The smallest phones (about 320 x 640): a shorter strip and copy, so the hero's Try RiseOhana stays
    on the first screen. Keep this after the 760px phone rules, which it overrides.
*/
@media (max-width: 340px) {
    .hero-art {
        height: 170px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .hero .promise {
        margin: 12px 0 4px;
    }
}
