/* ZoApps homepage layout. Shared look (tokens, type, buttons, header, FAQ, footer) lives in site.css. */

.home .h2 {
    font-size: clamp(2rem, 4.4vw, 3.25rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -.025em;
    text-wrap: balance
}

.home main > section,
.home #why {
    padding: 6.5rem 0
}

.home .section-header {
    margin-bottom: 3rem;
    text-align: center
}

.home .section-header .h2 {
    margin: 0 auto
}

.home .lead {
    font-size: 1.125rem;
    line-height: 1.6;
    max-width: 58ch
}

#apps {
    scroll-margin-top: 7rem
}

/* Full-width grey band behind the three promises */
.home #mission {
    background: var(--soft)
}

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

.home .hero-section {
    height: auto;
    min-height: 0;
    display: block;
    overflow-x: clip;
    text-align: center;
    padding: 13.5rem 0 6.5rem;
    background: #fff
}

.hero-copy {
    position: relative;
    max-width: 980px;
    margin: 0 auto
}

/* Keyword pills scattered around the headline. Decorative, so they are hidden
   from screen readers and only appear where there is room beside the copy. */
.hero-pills {
    display: none
}

.hero-copy .h1,
.hero-copy .hero-sub,
.hero-copy .hero-actions {
    position: relative;
    z-index: 1
}

.hero-pill {
    --rot: 0deg;
    --px: 0px;
    --py: 0px;
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1.1rem;
    border-radius: 999px;
    background: var(--kt);
    color: var(--ink);
    font-size: .8125rem;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .35);
    /* the scroll offset rides on transform, the idle float on translate, so they compose */
    transform: translate(var(--px), var(--py)) rotate(var(--rot));
    transition: transform .45s cubic-bezier(.22, .61, .36, 1);
    animation: hero-float 7s ease-in-out infinite
}

.hp-emoji {
    font-size: 1rem;
    letter-spacing: 0
}

/* Sit close to the headline; the scroll handler pushes each one outward from here.
   Offsets are fixed pixels from the 980px copy box, so the gutter at 1320px still holds them. */
.hp-1 {
    top: 5%;
    left: 15px;
    --rot: 11deg
}

.hp-2 {
    top: 37%;
    left: -54px;
    background: var(--lf);
    animation-delay: -1.4s;
    --rot: -5deg
}

.hp-3 {
    top: 69%;
    left: 30px;
    background: var(--pp);
    animation-delay: -2.8s;
    --rot: -8deg
}

.hp-4 {
    top: 4%;
    right: 40px;
    background: var(--lf);
    animation-delay: -4.2s;
    --rot: -10deg
}

.hp-5 {
    top: 35%;
    right: -54px;
    background: var(--mint);
    animation-delay: -5.6s;
    --rot: 4deg
}

.hp-6 {
    top: 67%;
    right: 30px;
    background: var(--kt);
    animation-delay: -3.5s;
    --rot: 9deg
}

@keyframes hero-float {

    0%,
    100% {
        translate: 0 0
    }

    50% {
        translate: 0 -10px
    }
}

@media (min-width: 1320px) {
    .hero-pills {
        display: block
    }
}

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

.hero-copy .h1 {
    font-weight: 900;
    font-size: clamp(2.9rem, 8vw, 6rem);
    line-height: .98;
    letter-spacing: -.035em;
    max-width: 13ch;
    margin: 0 auto;
    text-wrap: balance
}

.hero-copy .hero-sub {
    margin: 1.5rem auto 0;
    font-size: 1.25rem;
    line-height: 1.55;
    color: var(--ink-2);
    max-width: 38rem
}

.hero-copy .hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 2rem
}

/* Showcase: one colour tile per app, each holding a device */

/* ---------- App showcase: split by what you can actually use today ---------- */

.showcase {
    display: block;
    margin-top: 12.5rem
}


.showcase-pair {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 2.25rem
}

/* Status flag. On a narrow card there is not enough room beside the app name for
   a 128px pill, so below 560px it drops into the flow above the name instead of
   overlapping it. */
.tile-flag {
    display: inline-block;
    margin: 0 0 1.1rem;
    background: rgba(255, 255, 255, .5);
    color: var(--ink);
    border-radius: 999px;
    padding: .5rem .95rem;
    font-size: .8125rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: .01em;
    white-space: nowrap
}

@media (min-width: 560px) {
    .tile-flag {
        position: absolute;
        z-index: 1;
        top: 2rem;
        right: 2rem;
        margin: 0
    }
}

/* Every tile repeats the art at the same horizontal scale. The height is left to
   "auto" so each pattern keeps its own aspect ratio: the three source files are
   different shapes once their empty top margins are cropped out of the viewBox. */
.tile {
    background-position: 0 0;
    background-repeat: repeat;
    background-size: 200px auto;
    position: relative;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    border-radius: var(--round);
    overflow: hidden;
    color: var(--ink);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast)
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .45)
}

.tile:hover .tile-arrow {
    transform: translateX(3px)
}

.tile-body {
    padding: 2rem 2rem 0
}

.tile-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1.1rem
}

.tile-head img {
    width: 60px;
    height: 60px;
    border-radius: 17px;
    flex: 0 0 auto
}

.tile-id {
    min-width: 0
}

.tile-name {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1.1;
    margin: 0
}

.tile-name a {
    color: inherit;
    text-decoration: none
}

/* Stretches the product-page link over the whole card. The CTA sits above it. */
.tile-name a::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0
}

.tile-meta {
    font-size: .9375rem;
    font-weight: 700;
    color: rgba(0, 0, 0, .72);
    margin: .15rem 0 0
}

.tile-desc {
    font-size: 1.0625rem;
    line-height: 1.5;
    font-weight: 600;
    color: rgba(0, 0, 0, .8);
    margin: 0 0 1.15rem;
    max-width: 32ch
}

.tile-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0 0 1.35rem
}

.tile-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255, 255, 255, .72);
    border-radius: 999px;
    padding: .42rem .8rem;
    font-size: .8125rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap
}

.tile-chip.is-status {
    background: var(--ink);
    color: #fff
}

.tile-cta {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--ink);
    color: #fff;
    border-radius: 999px;
    padding: .8rem 1.4rem;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    transition: transform var(--transition-fast)
}

.tile-cta:hover {
    color: #fff;
    transform: translateY(-2px)
}

.tile-arrow {
    transition: transform var(--transition-fast)
}

.tile-icon {
    display: block;
    flex: 0 0 auto
}

/* ---------- Power Pals: two phones fanned out behind the front one ---------- */

.phone-stack {
    position: relative;
    display: block;
    width: calc(64% - 1rem);
    max-width: 236px;
    margin: auto auto -30px;
}

/* inside the stack the frames fill it; the stack itself does the sizing */
.phone-stack .device-phone {
    width: 100%;
    max-width: none;
    margin: 0;
}

.phone-stack .is-front {
    position: relative;
    z-index: 2;
}

.phone-stack .is-behind {
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 1;
    /* rotate about the bottom edge so they fan out and stay anchored to the card floor */
    transform-origin: 50% 100%;
    filter: brightness(.97);
}

.phone-stack .is-left {
    left: -31%;
    transform: rotate(-11deg);
}

.phone-stack .is-right {
    right: -31%;
    transform: rotate(11deg);
}


/* ---------- Soft hover motion on the three app screens ---------- */

/* transform only, so these stay on the compositor and cost nothing until hovered */
.tile .device {
    transition: transform .5s cubic-bezier(.22, .61, .36, 1);
}

/* Kids Tales: the browser eases up and forward a touch */
.tile-kt:hover .device-browser {
    transform: translateY(-6px) scale(1.015);
}

/* Laffari: the tablet lifts and tips very slightly */
.tile-lf:hover .device-tablet {
    transform: translateY(-9px) rotate(-1.2deg);
}

/* Power Pals: the fan opens wider and the front phone steps forward */
.tile-pp:hover .is-front {
    transform: translateY(-9px);
}

.tile-pp:hover .is-left {
    transform: translate(-18px, -4px) rotate(-17deg);
}

.tile-pp:hover .is-right {
    transform: translate(18px, -4px) rotate(17deg);
}

.showcase-note {
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 700;
    color: var(--ink-2)
}

.showcase-note a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px
}

/* News cards on the homepage */

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    list-style: none
}

.news-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
    color: var(--ink);
    text-decoration: none
}

.news-cover-wrap {
    display: block;
    width: 100%;
    border-radius: var(--round-md);
    overflow: hidden;
    background: var(--soft)
}

.news-cover {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform .4s ease
}

.news-card:hover .news-cover,
.news-card:focus-visible .news-cover {
    transform: scale(1.03)
}

.news-card .h3 {
    font-weight: 900;
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: -.015em;
    margin: 1.5rem 0 0;
    max-width: 22ch
}

.news-go {
    display: inline-flex;
    align-items: center;
    margin-top: 1.5rem;
    padding: .9rem;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    font-size: .9375rem;
    line-height: 1;
    transition: padding var(--transition-fast)
}

.news-go svg {
    flex: 0 0 auto
}

.news-go-label {
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    transition: max-width .3s ease, opacity .2s ease, margin var(--transition-fast)
}

.news-card:hover .news-go,
.news-card:focus-visible .news-go {
    padding: .9rem 1rem .9rem 1.25rem
}

.news-card:hover .news-go-label,
.news-card:focus-visible .news-go-label {
    max-width: 8rem;
    opacity: 1;
    margin-right: .55rem
}

/* No hover on touch screens, so the label stays visible there */

@media (hover: none) {
    .news-go {
        padding: .9rem 1rem .9rem 1.25rem
    }

    .news-go-label {
        max-width: 8rem;
        opacity: 1;
        margin-right: .55rem
    }
}

/* Pattern sits over the colour; drop bgr-2 / bgr-3 on .tile-lf / .tile-pp the same way */

.tile-kt {
    background-color: var(--lf);
    background-image: url(../img/cards/bgr-1.svg)
}

.tile-lf {
    background-color: var(--kt);
    background-image: url(../img/cards/bgr-2.svg)
}

.tile-pp {
    background-color: var(--pp);
    background-image: url(../img/cards/bgr-3.svg)
}

.device,
.device .screen {
    display: block
}

.device {
    margin: auto auto 0;
    width: calc(100% - 2rem)
}

.device img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover
}

.device-browser {
    max-width: 520px;
    background: #000;
    border-radius: 18px 18px 0 0;
    padding: 24px 6px 0;
    position: relative;
    box-shadow: 0 -2px 30px rgba(0, 0, 0, .08)
}

.device-browser::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FF6159;
    box-shadow: 13px 0 0 #FFBD2E, 26px 0 0 #28C941
}

.device-browser .screen {
    aspect-ratio: 1104 / 621;
    border-radius: 10px 10px 0 0;
    overflow: hidden
}

/* Tablet: even bezel all round, front camera centred above the screen */
.device-tablet {
    position: relative;
    max-width: 486px;
    /* overhang: the frame keeps going past the card edge, so neither the rounded
       corner nor the 9px hover lift ever shows its bottom edge */
    margin-bottom: -30px;
    background: var(--ink);
    border-radius: 30px 30px 0 0;
    padding: 22px 16px 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14)
}

.device-tablet::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #33373D;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12)
}

.device-tablet .screen {
    aspect-ratio: 4 / 3;
    border-radius: 14px 14px 0 0;
    overflow: hidden
}

/* Phone: thin bezel, deep corners, island at the top, buttons on both edges */
.device-phone {
position: relative;
    width: calc(58% - 1.5rem);
    max-width: 210px;
    background: var(--ink);
    border-radius: 25px 25px 0 0;
    padding: 6px 6px 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}

/* Volume pair on the left edge, power button on the right */
.device-phone::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 78px;
    width: 3px;
    height: 22px;
    border-radius: 3px 0 0 3px;
    background: var(--ink);
    box-shadow: 0 30px 0 0 var(--ink)
}

.device-phone::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 96px;
    width: 3px;
    height: 38px;
    border-radius: 0 3px 3px 0;
    background: var(--ink)
}

.device-phone .screen {
    position: relative;
    aspect-ratio: 328 / 514;
    border-radius: 18px 18px 0 0;
    overflow: hidden
}

/* The island sits on the screen itself, the way it does on a real phone */
.device-phone .screen::after {
    content: '';
    position: absolute;
    z-index: 2;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 15px;
    border-radius: 999px;
    background: var(--ink)
}

.device-phone .screen img {
    object-position: top
}

/* ---------- About ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: start
}

.about-grid .h2 {
    margin-bottom: 1.25rem
}

/* the founder's name links out, so it needs to look like a link in this big type */
.home .about-statement a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 5px
}

.home .about-statement a:hover {
    opacity: .72
}

.home .about-statement {
    font-size: clamp(1.35rem, 2.6vw, 1.875rem);
    line-height: 1.4;
    font-weight: 700;
    color: var(--ink);
    max-width: 30ch
}

.about-side {
    background: var(--ink);
    color: #fff;
    border-radius: var(--round);
    padding: 2.5rem;
    display: grid;
    gap: 1.75rem
}

.about-side h3 {
    font-size: .8125rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: rgba(255, 255, 255, .55);
    margin-bottom: 1rem
}

.about-side p {
    color: rgba(255, 255, 255, .8)
}

.about-side a {
    color: #fff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px
}

.about-side a:hover {
    opacity: .8
}

/* ---------- Early access ---------- */

.early-card {
    background: var(--kt);
    border-radius: var(--round-lg);
    padding: 3.5rem 1.5rem;
    text-align: center
}

.early-card .h2 {
    max-width: 16ch;
    margin: 0 auto .75rem
}

.home .early-card .lead {
    margin: 0 auto;
    color: var(--ink)
}

.ea-actions {
    margin: 2rem 0 0
}

.home .ea-note {
    font-size: .875rem;
    color: var(--ink);
    text-align: center;
    margin-top: .75rem
}

.ea-note a {
    color: var(--ink);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px
}

/* ---------- Breakpoints ---------- */

@media (min-width: 640px) {
    .ea-row {
        flex-direction: row
    }
}

@media (min-width: 900px) {
    /* 7 / 5 then 5 / 7, so the four promises read as a composition */
    .home .trust-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 1.25rem
    }

    .home .trust-tile:nth-child(4n+1),
    .home .trust-tile:nth-child(4n) {
        grid-column: span 7
    }

    .home .trust-tile:nth-child(4n+2),
    .home .trust-tile:nth-child(4n+3) {
        grid-column: span 5
    }

    .showcase-pair {
        grid-template-columns: 1fr 1fr
    }

    /* Featured tile: copy left, screenshot bleeding off the right edge */
    .tile-feature {
        display: grid;
        grid-template-columns: 1fr 1.05fr;
        align-items: center;
        gap: 1rem;
        /* Matching air above and to the right; it still runs off the bottom edge. */
        padding: 4.5rem 4.5rem 0 0
    }

    .tile-feature .tile-body {
        padding: 0 0 0 2.75rem
    }

    .tile-feature .tile-desc {
        font-size: 1.125rem
    }

    .tile-feature .device {
        width: 100%;
        max-width: none;
        margin: 0;
        /* Stretch, not start/end: the row is as tall as whichever column is taller,
           so stretching guarantees the screenshot starts at the top padding edge AND
           always reaches the bottom. With start/end a sliver of card colour appears
           under it near 920px, where the text column is the taller one. */
        align-self: stretch;
        display: flex;
        flex-direction: column
    }

    .tile-feature .device-browser {
        max-width: none;
        border-radius: 18px 18px 0 0;
        margin-bottom: -26px;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0
    }

    .tile-feature .device-browser .screen {
        border-radius: 10px 10px 0 0;
        /* fill whatever height the stretched frame has; the image is object-fit: cover */
        aspect-ratio: auto;
        flex: 1;
        min-height: 0
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .about-grid {
        grid-template-columns: 1.3fr 1fr;
        gap: 4rem
    }

    .early-card {
        padding: 5rem 3rem
    }
}

@media (max-width: 768px) {
    .home main > section,
    .home #why {
        padding: 4.5rem 0
    }

    .home .hero-section {
        padding: 7rem 0 4rem
    }

    .hero-copy .hero-sub {
        font-size: 1.0625rem;
        margin-top: 1.25rem
    }

    .home .hero-actions {
        flex-direction: column;
        align-items: stretch
    }

    .showcase {
        margin-top: 3.5rem
    }

    .device-phone {
        width: calc(52% - 1rem)
    }

    .home .section-header {
        margin-bottom: 2rem
    }

    .news-card .h3 {
        font-size: 1.375rem;
        margin-top: 1.25rem
    }

    .news-go {
        margin-top: 1.25rem
    }

    .about-side {
        padding: 1.5rem
    }
}

@media (prefers-reduced-motion: reduce) {
    .tile,
.tile .device,
.news-cover,
.news-go,
.news-go-label {
        transition: none
    }

    .tile:hover {
        transform: none
    }

    .tile-kt:hover .device-browser,
    .tile-lf:hover .device-tablet,
    .tile-pp:hover .is-front {
        transform: none
    }

    /* keep the fan at its resting angles rather than freezing it flat */
    .tile-pp:hover .is-left {
        transform: rotate(-11deg)
    }

    .tile-pp:hover .is-right {
        transform: rotate(11deg)
    }

    .news-card:hover .news-cover,
.news-card:focus-visible .news-cover {
        transform: none
    }
}
