/* The landing and thank-you pages (Components/Layout/LandingLayout). They dig down through layers: sky, dirt, stone, dark
   stone, gold ore, bedrock; each band spans the width with a 74rem inner, and a pixel edge joins one layer to the next.
   Tokens, fonts and the .btn blocks come from site.css. --s is the pixel scale of a drawing. */

body:has(.landing) .site-header {
    border-bottom: 0;
}

.landing {
    flex: 1 0 auto;
    --s: 5;
}

.landing .px {
    display: block;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.landing .sprite {
    width: calc(var(--w) * var(--s) * 1px);
    max-width: 100%;
    height: auto;
}

.wrap {
    max-width: 74rem;
    margin: 0 auto;
    padding-left: var(--gutter-l);
    padding-right: var(--gutter-r);
}

/* ---------- Bands and the edges between them ---------- */
.band {
    position: relative;
}

.band-in {
    padding-block: 4.5rem 5rem;
}

.edge {
    height: 64px;
    background-repeat: repeat-x;
    background-size: 64px 64px;
    image-rendering: pixelated;
}

.edge-grass {
    background-image: url("/img/pixel/edge-grass.png");
}

.edge-dirt-stone {
    background-color: var(--stone);
    background-image: url("/img/pixel/edge-dirt-stone.png");
}

.edge-stone-deep {
    background-color: var(--deep);
    background-image: url("/img/pixel/edge-stone-deep.png");
}

.edge-deep-stone {
    background-color: var(--stone);
    background-image: url("/img/pixel/edge-deep-stone.png");
}

.edge-stone-bed {
    background-color: var(--bed);
    background-image: url("/img/pixel/edge-stone-bed.png");
}

.sky {
    overflow: hidden;
    background: linear-gradient(var(--sky-hi) 0 26%, var(--sky-mid) 26% 64%, var(--sky-lo) 64%);
}

.dirt,
.stone,
.deep,
.ore,
.bed {
    background-size: 64px 64px;
    image-rendering: pixelated;
}

.dirt {
    --focus: var(--gold-light);
    background-color: var(--dirt);
    background-image: url("/img/pixel/tex-dirt.png");
    color: var(--cream);
}

.stone {
    background-color: var(--stone);
    background-image: url("/img/pixel/tex-stone.png");
}

.deep {
    --focus: var(--gold-light);
    background-color: var(--deep);
    background-image: url("/img/pixel/tex-deep.png");
    color: var(--cream);
}

.ore {
    background-color: var(--stone);
    background-image: url("/img/pixel/tex-ore.png");
    background-size: 192px 192px;
}

.bed {
    --focus: var(--gold-light);
    background-color: var(--bed);
    background-image: url("/img/pixel/tex-bed.png");
    color: var(--cream);
}

/* Links on the dark layers are cream; buttons keep their own colours (a gold button needs ink text). */
.dirt a:not(.btn),
.deep a:not(.btn),
.bed a:not(.btn) {
    color: var(--cream);
}

.band-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1;
}

.band-sub {
    margin: 0.9rem 0 0;
    max-width: 34rem;
    font-size: 1.15rem;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    display: grid;
    gap: 2.5rem;
    padding-block: 2rem 0;
}

.hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.7rem, 11vw, 5.6rem);
    line-height: 0.95;
}

/* The second line: cream with a chunky ink outline, the way a game title is lettered. */
.hero h1 .up {
    display: block;
    margin-top: 0.12em;
    color: var(--cream);
    text-shadow:
        4px 0 0 var(--ink), -4px 0 0 var(--ink), 0 4px 0 var(--ink), 0 -4px 0 var(--ink),
        4px 4px 0 var(--ink), -4px 4px 0 var(--ink), 4px -4px 0 var(--ink), -4px -4px 0 var(--ink);
}

.lead {
    margin: 0;
    max-width: 31rem;
    font-size: 1.2rem;
}

/* The home page's headline is the slogan. Each half stays on one line from a 360px phone up: in Pixelify Sans 700
   with ligatures off, "Make your child" is 7.67em and "financially aware." 8.95em, plus the outline. */
.hero h1.hero-slogan {
    font-size: clamp(2rem, 9.2vw, 4.6rem);
    text-wrap: balance;
}

.lead-more {
    margin: -0.4rem 0 0;
    max-width: 31rem;
    font-size: 1.02rem;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.link-how {
    font-weight: 700;
    font-size: 1.05rem;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-weight: 600;
}

.meta li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.meta li::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--ink);
}

.clouds {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.cloud {
    position: absolute;
}

.cloud.c1 {
    display: none;
}

.cloud.c2 {
    --s: 3;
    left: -48px;
    top: 66%;
}

.cloud.c3 {
    --s: 4;
    right: -56px;
    top: 79%;
}

.stage {
    --s: 5;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5.5rem;
}

.brick-wrap {
    position: relative;
}

/* ---------- The drawn brick and its e-ink screen. The balance is in the pixel face; the small lines are not. ---------- */
.brick {
    position: relative;
    width: calc(44px * var(--s));
    max-width: 100%;
    aspect-ratio: 44 / 58;
}

.brick > img {
    width: 100%;
    height: 100%;
}

.eink {
    position: absolute;
    left: 18.18%;
    top: 12.07%;
    width: 63.64%;
    height: 48.28%;
    display: flex;
    flex-direction: column;
    padding: 3.2% 3.8% 2.6%;
    overflow: hidden;
    background: var(--paper);
    color: var(--paper-ink);
    container-type: inline-size;
    font-family: var(--font-body);
}

.eink-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2.5cqw;
    border-bottom: max(1px, 1.4cqw) solid currentColor;
    font-size: 9cqw;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.batt {
    display: inline-flex;
    align-items: center;
    gap: 2cqw;
    font-weight: 600;
}

.batt i {
    width: 11cqw;
    height: 6cqw;
    padding: max(1px, 0.8cqw);
    border: max(1px, 1cqw) solid currentColor;
    background: linear-gradient(90deg, currentColor 80%, transparent 80%) content-box;
}

.eink-bal {
    margin-top: 7cqw;
    font-family: var(--font-display);
    font-size: 26cqw;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.eink-bal.eink-word {
    margin-top: 12cqw;
    font-size: 15cqw;
}

.eink-cur {
    text-align: center;
    font-size: 8.5cqw;
    font-weight: 600;
    letter-spacing: 0.12em;
}

.eink-last {
    margin-top: auto;
    overflow: hidden;
    font-size: 8.5cqw;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.eink-upd {
    font-size: 7cqw;
    white-space: nowrap;
    opacity: 0.75;
}

/* The full refresh of a real e-ink panel: it flashes black and white before the new picture. */
@keyframes eink-flash {
    0% { filter: none; }
    14% { filter: invert(1); }
    30% { filter: none; }
    46% { filter: invert(1); }
    62%, 100% { filter: none; }
}

@keyframes eink-blank {
    0%, 14% { opacity: 1; }
    30%, 58% { opacity: 0; }
    62%, 100% { opacity: 1; }
}

.eink.flash {
    animation: eink-flash 0.72s steps(1, end);
}

.eink.flash > * {
    animation: eink-blank 0.72s steps(1, end);
}

.drop {
    position: absolute;
    left: 50%;
    top: 0;
    z-index: 2;
    opacity: 0;
    transform: translate(-50%, -190%);
    pointer-events: none;
}

.drop.go {
    animation: drop 0.5s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes drop {
    0% { opacity: 0; transform: translate(-50%, -190%); }
    12% { opacity: 1; }
    88% { opacity: 1; transform: translate(-50%, 10%); }
    100% { opacity: 0; transform: translate(-50%, 40%); }
}

/* A spend: the coin leaves the brick, the drop run backwards. */
.drop.rise {
    animation: rise 0.5s cubic-bezier(0, 0.55, 0.45, 1) forwards;
}

@keyframes rise {
    0% { opacity: 0; transform: translate(-50%, 40%); }
    12% { opacity: 1; transform: translate(-50%, 10%); }
    88% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -190%); }
}

.toast {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 15rem;
    padding: 0.7rem 1rem 0.7rem 0.8rem;
    border: 4px solid var(--ink);
    background: var(--deep-dark);
    box-shadow: inset 3px 3px 0 var(--deep-light), inset -3px -3px 0 var(--bed-dark);
    color: var(--cream);
    opacity: 0;
    transform: translate(-50%, -8px);
    transition: opacity 0.2s ease-out, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast .sprite {
    --s: 3;
    flex: none;
}

.toast p {
    margin: 0;
}

.toast-title {
    color: var(--gold);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.toast.is-spend .toast-title {
    color: var(--cream);
}

.toast-why {
    font-size: 0.95rem;
    line-height: 1.25;
}

.island {
    --s: inherit;
}

.try {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.4rem;
}

.try-label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.chip {
    padding: 0.55em 0.75em;
    border: 3px solid var(--ink);
    background: var(--cream);
    box-shadow: inset 3px 3px 0 var(--white), inset -3px -3px 0 var(--cream-dark);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.chip b {
    color: var(--bonus);
    font-weight: 700;
}

.chip.is-spend b {
    color: var(--ink);
}

.chip:hover {
    filter: brightness(1.04);
}

.chip:active {
    box-shadow: inset 3px 3px 0 var(--cream-dark), inset -3px -3px 0 var(--white);
    transform: translateY(2px);
}

/* ---------- The promo video (tools/promo), at the top of How it works ---------- */
.promo {
    max-width: 58rem;
    margin: 2.5rem 0 0;
}

.promo video {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 4px solid var(--ink);
    background: var(--ink);
    box-shadow: 6px 6px 0 var(--dirt-dark);
}

.promo figcaption {
    margin-top: 0.75rem;
    font-weight: 600;
}

/* ---------- How it works ---------- */
.steps {
    display: grid;
    gap: 1.75rem;
    margin: 3rem 0 0;
    padding: 0;
    list-style: none;
}

.step {
    display: grid;
    align-content: start;
    gap: 1rem;
}

.step p {
    margin: 0;
    max-width: 24rem;
}

.step-art {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem;
    height: 200px;
    padding-bottom: 14px;
    border: 4px solid var(--ink);
    background: var(--dirt-dark);
    box-shadow: inset 4px 4px 0 #5E3A21, inset -4px -4px 0 #9C6941;
}

.step-art .brick {
    --s: 3;
}

.step-art .arrow {
    --s: 3;
    align-self: center;
    margin-top: 18px;
}

.step-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
}

.step-link {
    display: none;
}

.num {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.1rem;
    height: 2.1rem;
    border: 3px solid var(--ink);
    background: var(--gold);
    box-shadow: inset 3px 3px 0 var(--gold-light), inset -3px -3px 0 var(--gold-dark);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.phone {
    --s: 4;
    position: relative;
    width: calc(24px * var(--s));
    aspect-ratio: 24 / 40;
}

.phone > img {
    width: 100%;
    height: 100%;
}

.phone-screen {
    position: absolute;
    left: 8.33%;
    top: 10%;
    width: 83.33%;
    height: 75%;
    display: flex;
    flex-direction: column;
    padding: 7.5% 6.7%;
    container-type: inline-size;
    color: var(--ink);
}

.ps-label {
    font-size: 11cqw;
    font-weight: 600;
    color: var(--ink-soft);
}

.ps-amt {
    margin-top: 6cqw;
    color: var(--bonus);
    font-family: var(--font-display);
    font-size: 24cqw;
    font-weight: 700;
    line-height: 1;
}

.ps-why {
    margin-top: 4cqw;
    font-size: 12cqw;
    line-height: 1.15;
}

.ps-btn {
    margin-top: auto;
    padding: 5cqw 0;
    border: max(1px, 2.5cqw) solid var(--ink);
    background: var(--gold);
    font-size: 12cqw;
    font-weight: 700;
    text-align: center;
}

/* ---------- Meet the brick ---------- */
.meet {
    display: grid;
    gap: 3rem;
    align-items: center;
}

.meet-art {
    display: flex;
    justify-content: center;
}

.meet-art .brick {
    --s: 5;
}

.marker {
    position: absolute;
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 3px solid var(--ink);
    background: var(--gold);
    box-shadow: inset 3px 3px 0 var(--gold-light), inset -3px -3px 0 var(--gold-dark);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    transform: translate(-50%, -50%);
}

.marker.m1 { left: 10%; top: 5%; }
.marker.m2 { left: 0%; top: 32%; }
.marker.m3 { left: 100%; top: 18%; }

.parts {
    display: grid;
    gap: 1.25rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.parts li {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.9rem;
}

.parts h3 {
    margin: 0 0 0.3rem;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
}

.parts p {
    margin: 0;
    max-width: 30rem;
}

.plate {
    margin-top: 2.25rem;
    padding: 1.1rem 1.25rem 1.2rem;
    border: 4px solid var(--ink);
    background: #ECEEF0;
    box-shadow: inset 4px 4px 0 var(--white), inset -4px -4px 0 #BCC2C9;
}

.plate h3 {
    margin: 0 0 0.7rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.plate dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem 1.25rem;
    margin: 0;
}

.plate dt {
    font-weight: 600;
}

.plate dd {
    min-width: 0;
    margin: 0;
}

/* ---------- Why I made it ---------- */
.story {
    display: grid;
    gap: 2rem;
}

.story-note {
    display: grid;
    gap: 1.1rem;
    max-width: 38rem;
    font-size: 1.22rem;
    line-height: 1.6;
}

.story-note p {
    margin: 0;
}

.sign {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
    color: var(--gold);
    font-size: 1.05rem;
    font-weight: 600;
}

.sign .sprite {
    --s: 3;
}

/* ---------- Order ---------- */
.order-panel {
    display: grid;
    gap: 2rem;
    max-width: 58rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border: 4px solid var(--ink);
    background: var(--cream);
    box-shadow: inset 6px 6px 0 var(--white), inset -6px -6px 0 var(--cream-dark);
}

.order-art {
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.order-art .brick {
    --s: 4;
}

.order-body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.order-body h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 5vw, 2.7rem);
    font-weight: 700;
    line-height: 1.05;
}

.price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.9rem;
}

.price strong {
    font-family: var(--font-display);
    font-size: clamp(4rem, 14vw, 6rem);
    font-weight: 700;
    line-height: 0.9;
}

.price span {
    font-size: 1.1rem;
    font-weight: 600;
}

.ticks {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 1.08rem;
}

.ticks li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.ticks .sprite {
    --s: 3;
    flex: none;
    margin-top: 0.2em;
}

.fine-print {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* ---------- Questions ---------- */
.faq {
    display: grid;
    gap: 0.9rem;
    max-width: 52rem;
    margin-top: 2.5rem;
}

.faq details {
    border: 4px solid var(--ink);
    background: var(--deep);
    box-shadow: inset 4px 4px 0 var(--deep-light), inset -4px -4px 0 var(--bed-dark);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    font-size: 1.12rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    flex: none;
    display: grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border: 3px solid var(--ink);
    background: var(--gold);
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
}

.faq details[open] summary::after {
    content: "\2212";
}

.faq details p {
    max-width: 42rem;
    margin: 0;
    padding: 0 1.2rem 1.2rem;
}

/* ---------- The landing footer, on bedrock ---------- */
.site-footer-bed {
    border-top: 4px solid var(--ink);
    background: var(--bed-dark);
}

.site-footer-bed .site-footer-inner {
    background: none;
}

/* ---------- Thank-you page ---------- */
.thanks {
    display: grid;
    gap: 2.5rem;
    align-items: center;
    padding-block: 3rem 4rem;
}

.thanks-copy {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    max-width: 34rem;
}

.thanks-copy h1 {
    margin: 0;
    font-size: clamp(2.6rem, 8vw, 4.4rem);
    line-height: 0.98;
}

.thanks-copy p {
    margin: 0;
    font-size: 1.15rem;
}

.thanks-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.thanks-art {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
}

/* The order block on the thank-you page, after paying on /preorder */
.order-no {
    display: inline-block;
    padding: 0.3rem 0.65rem;
    border: 3px solid var(--ink);
    background: var(--cream);
    font-weight: 700;
}

.thanks-track {
    display: grid;
    gap: 0.4rem;
    padding: 1rem 1.1rem;
    border: 4px solid var(--ink);
    background: var(--cream);
    box-shadow: inset 4px 4px 0 var(--white), inset -4px -4px 0 var(--cream-dark);
}

.thanks-track p {
    margin: 0;
    font-size: 1rem;
}

.thanks-ground {
    height: 48px;
}

/* ---------- Phone dock: the Pre-order bar once the hero's button has scrolled away ---------- */
.dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem var(--gutter-r) calc(0.6rem + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
    border-top: 4px solid var(--ink);
    background: var(--deep-dark);
    color: var(--cream);
    font-weight: 600;
    --focus: var(--gold-light);
    transform: translateY(115%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock.show {
    transform: none;
}

@media (max-width: 899px) {
    body:has(.dock) .site-footer-inner {
        padding-bottom: calc(2rem + 72px);
    }
}

/* ---------- Narrow and wide ---------- */
@media (max-width: 380px) {
    .stage {
        --s: 4;
    }
}

@media (min-width: 900px) {
    .hero {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        align-items: end;
        gap: 3rem;
        padding-top: 3rem;
    }

    .hero-copy {
        padding-bottom: 5.5rem;
    }

    /* The copy column is about half the width here: one line per half from 900px up, with room to spare for other
       browsers' rounding (at least 12px beside "financially aware." at every width). */
    .hero h1.hero-slogan {
        font-size: clamp(2.4rem, 4.7vw, 3.8rem);
    }

    .stage {
        --s: 6;
        padding-top: 6rem;
    }

    .cloud.c1 {
        --s: 5;
        display: block;
        left: 40%;
        top: 8%;
    }

    .cloud.c2 {
        left: 4%;
        top: 72%;
    }

    .cloud.c3 {
        --s: 4;
        right: 3%;
        top: 20%;
    }

    .steps {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: start;
        gap: 1.25rem;
    }

    .step-link {
        --s: 3;
        display: block;
        align-self: start;
        margin-top: 88px;
    }

    .meet {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        gap: 4rem;
    }

    .meet-art .brick {
        --s: 7;
    }

    .story {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        align-items: start;
        gap: 4rem;
    }

    .order-panel {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 3rem;
        padding: 2.5rem 3rem;
    }

    .order-art .brick {
        --s: 5;
    }

    .thanks {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        padding-block: 4rem 5rem;
    }

    .dock {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast,
    .dock {
        transition: none;
    }
}
