/* The public website. Loaded after rq.css and parent.css, which still holds the home page's own rules
   (the hero, the question, the wire). Everything here is shared by the website's pages. */

.m-skip { position: absolute; left: -9999px; }
.m-skip:focus { left: 16px; top: 12px; z-index: 20; padding: 10px 14px; background: var(--surface); color: var(--text); border: 2.5px solid var(--ink); border-radius: 12px; font-weight: 700; }

/* Links in running text. Buttons, cards and the navigation carry a class and keep their own colour. */
.m-main a:not([class]) { color: var(--accent); text-underline-offset: 3px; }
.m-shell-bare { padding-top: 24px; }

/* Header */
.m-top { gap: 16px; }
.m-nav { display: flex; gap: 2px; flex: 1; justify-content: center; }
.m-nav a { padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.m-nav a:hover { background: var(--surface-2); }
.m-nav a.active { background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--ink); }
.m-top-actions { display: flex; align-items: center; gap: 14px; }
.m-top .m-top-cta { min-height: 44px; padding: 8px 16px; font-size: .98rem; margin-bottom: 0; white-space: nowrap; }
.m-signin { text-decoration: none; white-space: nowrap; }
.m-menu { display: none; position: relative; }
.m-menu summary { list-style: none; cursor: pointer; font-weight: 700; padding: 9px 14px; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--surface); user-select: none; }
.m-menu summary::-webkit-details-marker { display: none; }
.m-menu nav { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; min-width: 240px; display: flex; flex-direction: column; padding: 8px; background: var(--surface); border: 2.5px solid var(--ink); border-radius: 16px; box-shadow: var(--shadow-hard); }
.m-menu nav a { padding: 11px 12px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
.m-menu nav a:hover { background: var(--surface-2); }

/* The top of a page that isn't the home page */
.m-head { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.m-head-text { display: flex; flex-direction: column; gap: 18px; }
.m-head h1, .m-lost h1 { font-family: var(--display); font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -.035em; max-width: 20ch; text-wrap: balance; }
.m-head-pet { width: 200px; height: 198px; }
.m-section h3 { font-size: 1.15rem; }
.m-narrow { max-width: 46em; }

/* A grid of cards, some of them links */
.m-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.m-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
a.m-card { transition: transform .1s ease; }
a.m-card:hover { transform: translateY(-2px); }
a.m-card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.m-card-tag { font-size: .8rem; font-weight: 700; }
.m-card-more { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--accent); }

/* Long-form writing: guides, About */
.m-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .92rem; color: var(--muted); }
.m-crumbs a { color: var(--muted); }
.m-article { display: flex; flex-direction: column; gap: 22px; }
.m-article-head { display: flex; flex-direction: column; gap: 14px; max-width: 46em; }
.m-article-head h1 { font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; letter-spacing: -.035em; text-wrap: balance; }
.m-byline { color: var(--muted); font-size: .95rem; }
.m-prose { max-width: 40em; display: flex; flex-direction: column; gap: 16px; font-size: 1.08rem; line-height: 1.65; }
.m-prose h2 { font-family: var(--display); font-size: clamp(1.3rem, 2.6vw, 1.65rem); letter-spacing: -.03em; margin-top: 20px; }
.m-prose h3 { font-size: 1.15rem; margin-top: 6px; }
.m-prose ul, .m-prose ol { margin: 0; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.m-aside { padding: 14px 18px; border-left: 6px solid var(--gold); border-radius: 0 14px 14px 0; background: var(--surface); }
.m-sources { font-size: .95rem; color: var(--muted); }

/* Questions and answers */
.m-faqs { display: flex; flex-direction: column; gap: 10px; max-width: 46em; }
.m-faq { padding: 0 18px; background: var(--surface); border: 2.5px solid var(--ink); border-radius: 16px; }
.m-faq summary { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; cursor: pointer; font-weight: 700; list-style: none; }
.m-faq summary::-webkit-details-marker { display: none; }
.m-faq summary::after { content: "+"; flex: none; font-weight: 700; color: var(--accent); }
.m-faq[open] summary::after { content: "\2212"; }
.m-faq p { padding: 0 0 16px; max-width: 42em; }

/* The way in at the foot of a page */
.m-band { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 28px 32px; background: #5b3ff0; color: #fff; border: 2.5px solid var(--ink); border-radius: 26px; box-shadow: var(--shadow-hard); }
.m-band h2 { font-family: var(--display); font-size: clamp(1.4rem, 2.8vw, 1.9rem); letter-spacing: -.03em; }
.m-band-text { display: flex; flex-direction: column; gap: 12px; }
.m-band-pet { width: 150px; height: 148px; }
.m-band .m-cta { align-items: center; margin-top: 4px; }
.m-band-btn { background: var(--gold); color: #1d1f3f; }
.m-band-link { padding: 10px 4px; color: #fff; font-weight: 600; }

/* Where to get the app */
.m-stores { display: flex; flex-wrap: wrap; gap: 12px; }
.m-stores .m-store { flex-direction: column; align-items: flex-start; gap: 0; min-width: 180px; min-height: 62px; padding: 8px 20px; }
.m-store-small { font-size: .75rem; font-weight: 600; color: var(--muted); }
.m-store-name { font-size: 1.1rem; }

/* Prices */
.m-price { font-family: var(--display); font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.m-price small { font-family: 'Lexend', system-ui, sans-serif; font-size: 1rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.m-plan { gap: 12px; }
.m-plan .btn { margin-top: auto; }
.m-plan-one { max-width: 40em; }
.m-table { width: 100%; max-width: 46em; border-collapse: collapse; background: var(--surface); border: 2.5px solid var(--ink); border-radius: 16px; overflow: hidden; border-spacing: 0; }
.m-table th, .m-table td { padding: 12px 14px; text-align: left; border-bottom: 1.5px solid var(--soft-line); vertical-align: top; }
.m-table tr:last-child th, .m-table tr:last-child td { border-bottom: 0; }
.m-table thead th { background: var(--surface-2); }
.m-table-wrap { overflow-x: auto; }

/* A starter topic's page */
.m-things { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.m-thing { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 2px solid var(--soft-line); border-radius: 14px; }
.m-thing strong { line-height: 1.25; }
.m-thing span { color: var(--muted); }
/* The other topics on a library topic's page: a plain list of links, in columns where there's room. */
.m-topic-list { margin: 0 0 14px; padding: 0; list-style: none; columns: 3 16em; column-gap: 24px; }
.m-topic-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--soft-line); }
.m-thing a { color: inherit; }
.m-hooks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.m-hook-card { display: flex; flex-direction: column; gap: 4px; padding: 0 0 12px; border-bottom: 2px dashed var(--soft-line); }
.m-hook-card strong { color: color-mix(in srgb, var(--subject, var(--accent)) 60%, var(--text)); }
.m-try { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.m-try .m-q-text { font-size: 1.12rem; max-width: none; }
.m-try .m-opts { grid-template-columns: 1fr; }
.m-topic-subject { font-weight: 700; }
.m-facts { display: flex; flex-wrap: wrap; gap: 10px; }
.m-fact { padding: 6px 12px; background: var(--surface); border: 2px solid var(--soft-line); border-radius: 99px; font-size: .92rem; font-weight: 600; }

/* A child's phone, drawn */
.m-phone { width: min(320px, 100%); display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 22px; background: var(--paper); border: 3px solid var(--ink); border-radius: 34px; box-shadow: 0 6px 0 var(--ink); }
.m-phone-label { font-family: var(--display); font-weight: 700; font-size: .95rem; letter-spacing: -.02em; }
.m-plan-first { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: #5b3ff0; color: #fff; border: 2.5px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-hard); }
.m-plan-first strong { font-size: 1.1rem; line-height: 1.2; }
.m-plan-first span { font-size: .9rem; opacity: .92; }
.m-plan-first em { margin-top: 6px; font-style: normal; font-weight: 700; }
.m-plan-then { display: flex; flex-direction: column; padding: 4px 14px; background: var(--surface); border: 2px solid var(--soft-line); border-radius: 16px; }
.m-plan-then span { padding: 9px 0; font-size: .92rem; font-weight: 600; border-bottom: 1.5px solid var(--soft-line); }
.m-plan-then span:last-child { border-bottom: 0; }
.m-path { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; counter-reset: path; max-width: 46em; }
.m-path li { counter-increment: path; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.m-path li::before { content: counter(path); display: grid; place-items: center; width: 44px; height: 44px; font-family: var(--display); font-weight: 700; background: var(--surface); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-hard); }
.m-path strong { display: block; }

/* Footer */
.m-foot { gap: 10px; }
.m-foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-bottom: 14px; }
.m-foot-cols nav { display: flex; flex-direction: column; gap: 8px; }
.m-foot-h { font-size: .95rem; font-weight: 700; }
.m-foot .m-foot-cols a { color: var(--text); text-decoration: none; }
.m-foot .m-foot-cols a:hover { text-decoration: underline; }
.m-foot-stores a { margin-left: 10px; }

@media (max-width: 940px) {
    .m-nav, .m-signin { display: none; }
    .m-menu { display: block; }
    .m-top-actions { margin-left: auto; }
    .m-menu .m-menu-close { display: none; }
    .m-menu[open] .m-menu-open { display: none; }
    .m-menu[open] .m-menu-close { display: inline; }
}

@media (max-width: 760px) {
    .m-head { grid-template-columns: 1fr; gap: 12px; }
    .m-head-pet { width: 120px; height: 118px; order: -1; }
    .m-band { grid-template-columns: 1fr; padding: 22px; gap: 14px; }
    .m-band-pet { width: 104px; height: 102px; }
    .m-foot-cols { grid-template-columns: 1fr 1fr; }
    .m-stores .m-store { flex: 1 1 100%; }
}

@media (max-width: 480px) {
    .m-top .m-top-cta { display: none; }
}

/* Contrast. The subject colours are bright, so words in them are mixed further towards the text colour
   here than in the app, and the status chips drawn on the website carry dark words. */
.m-subject { color: color-mix(in srgb, #f08a24 55%, var(--text)); }
.m-topic-subject { color: color-mix(in srgb, var(--subject) 55%, var(--text)); }
.m-card-tag { color: color-mix(in srgb, var(--subject, var(--muted)) 55%, var(--text)); }
.m-progress .chip-struggle, .m-progress .chip-learned, .m-q .chip-learned { color: #1d1f3f; }

/* Until Lexend arrives the page is drawn in a system font. Lexend is about 8% wider, so text moved when it
   swapped in. This stand-in is the system font stretched to Lexend's width and height (measured in Chrome
   against Arial), which keeps every line where it is. */
@font-face {
    font-family: 'Lexend Fallback';
    src: local('Arial'), local('Roboto'), local('Helvetica Neue');
    size-adjust: 108%;
    ascent-override: 93%;
    descent-override: 23%;
    line-gap-override: 0%;
}
.m-shell { font-family: 'Lexend', 'Lexend Fallback', system-ui, sans-serif; --display: 'Lexend', 'Lexend Fallback', system-ui, sans-serif; }

/* Screenshots of the app */
.m-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.m-shot { display: block; width: 100%; max-width: 280px; height: auto; aspect-ratio: 9 / 16; border: 3px solid var(--ink); border-radius: 26px; box-shadow: 0 6px 0 var(--ink); background: var(--paper); }
.m-fig figcaption { max-width: 280px; text-align: center; font-size: .92rem; color: var(--muted); }
.m-shots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: start; }
.m-shots-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); gap: 24px; justify-content: start; }
.m-head .m-fig { width: 220px; }
@media (max-width: 760px) {
    /* Four phones side by side are too small to read: they scroll sideways inside their own strip instead. */
    .m-shots { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 12px; margin: 0 -4px; }
    .m-shots .m-fig { scroll-snap-align: start; }
    .m-shots-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .m-head .m-fig { width: 170px; }
}

/* ===== The home page's opening: a purple band with the question card on its edge ===== */
.m-hero { position: relative; isolation: isolate; color: #fff; padding: 56px 48px 56px; }
.m-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border: 2.5px solid var(--ink); border-radius: 32px;
    background-color: #5b3ff0;
    background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 24px 24px; box-shadow: var(--shadow-hard);
}
.m-hero h1 { color: #fff; font-size: clamp(2.3rem, 4.6vw, 3.6rem); }
/* The headline is the revision; the pigeon is the aside under it, set smaller. */
.m-h1-main, .m-h1-aside { display: block; }
.m-h1-aside { margin-top: .5em; font-size: .42em; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
/* Which stages it's for, as small links under the headline. Quieter than the buttons. */
.m-stages { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.m-hero .m-stages a { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border: 2px solid rgba(255,255,255,.55); border-radius: 99px; color: #fff; font-size: .92rem; font-weight: 600; text-decoration: none; }
.m-hero .m-stages a:hover, .m-hero .m-stages a:focus-visible { border-color: var(--gold); background: rgba(255,255,255,.1); }
.m-hero .m-lead { color: rgba(255,255,255,.92); }
.m-hero .m-small { color: rgba(255,255,255,.82); }
.m-hero .m-hero-text p a { color: #fff; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.m-hero .btn-primary { background: var(--gold); color: #1d1f3f; }
.m-hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.m-hero .m-demo { color: var(--text); }
/* The pigeon stands on the question card: above it on a wide screen, above the headline on a phone. */
.m-hero { grid-template-areas: "text pet" "text demo"; grid-template-rows: auto auto; row-gap: 0; }
.m-hero-text { grid-area: text; }
.m-hero > .m-demo-pet { grid-area: pet; position: relative; left: auto; top: auto; justify-self: center; align-self: end; width: 176px; height: 174px; margin: 0 0 -8px; z-index: 1; }
.m-hero .m-demo { grid-area: demo; padding-top: 0; align-self: start; }

/* A band that sets a section apart from the ones round it */
.m-alt { padding: 36px 32px; background: var(--surface); border: 2.5px solid var(--ink); border-radius: 28px; }

@media (max-width: 760px) {
    /* Phones: full-width bands, centred openings, and nothing hugging the left edge. */
    .m-main { gap: 0; padding-top: 0; }
    .m-main > section, .m-main > article { padding-top: 44px; padding-bottom: 44px; }
    .m-section > h2, .m-section > .m-sub, .m-split > div > h2, .m-split > div > .m-sub { text-align: center; margin-inline: auto; }
    .m-section h2 { font-size: clamp(1.7rem, 7.4vw, 2.1rem); line-height: 1.12; text-wrap: balance; }
    .m-section > .m-note { text-align: center; margin-inline: auto; }

    /* The opening. The headline is a poster on purple, set left. Sign up and what it costs come straight under
       it, with the pigeon beside them standing on the question, so its face is in view when an answer is tapped.
       The purple ends part-way down the question; what the app is and the rest follow on paper.
       Rows: 1 the headline, 2 sign up, 3 what it costs, 4 the question (the pigeon and the purple share them),
       then the rest in order. */
    .m-main > .m-hero { --pw: clamp(118px, 32vw, 140px); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: none; gap: 0; margin: 0 -16px; padding: 26px 20px 40px; text-align: left; }
    .m-hero-text, .m-hero .m-cta { display: contents; }
    .m-hero::before { position: relative; inset: auto; grid-area: 1 / 1 / 5 / 2; align-self: stretch; margin: -26px -20px 132px; border-width: 0 0 2.5px; border-radius: 0 0 36px 36px; box-shadow: none; }
    .m-hero-title { grid-area: 1 / 1; }
    .m-hero .m-stages a { min-height: 40px; }
    .m-hero h1 { font-size: clamp(2.5rem, 11.6vw, 3.3rem); line-height: 1.02; letter-spacing: -.045em; max-width: none; text-wrap: wrap; }
    .m-h1-main { max-width: 11ch; }
    .m-h1-aside { font-size: .46em; }
    .m-hero .m-cta .btn-primary { grid-area: 2 / 1; justify-self: start; min-height: 58px; margin-top: 18px; padding-inline: 28px; font-size: 1.15rem; }
    .m-hero .m-free { grid-area: 3 / 1; justify-self: start; max-width: calc(100% - var(--pw)); margin-top: 10px; color: #fff; font-weight: 600; text-wrap: balance; }
    .m-hero > .m-demo-pet { grid-area: 4 / 1; justify-self: end; align-self: start; width: var(--pw); height: calc(var(--pw) * .989); margin: calc(30px - var(--pw) * .989) -4px 0 0; }
    .m-hero .m-demo { grid-area: 4 / 1; width: 100%; margin: 24px 0 0; }
    .m-hero .m-q { box-shadow: 0 6px 0 var(--ink); }
    .m-hero .m-lead { margin-top: 30px; color: var(--text); font-size: 1.1rem; line-height: 1.5; }
    .m-hero .m-cta .btn-ghost { width: 100%; min-height: 50px; margin-top: 20px; font-size: 1.02rem; color: var(--text); border-color: var(--soft-line); }
    .m-hero .m-small:not(.m-free) { margin-top: 14px; color: var(--muted); }
    .m-hero .m-hero-text p a { color: var(--accent); text-decoration-color: currentColor; text-decoration-thickness: auto; }

    .m-alt { margin: 0 -16px; padding-left: 20px; padding-right: 20px; border-width: 2.5px 0; border-radius: 0; }

    .m-start { background: #5b3ff0; color: #fff; text-align: left; }
    .m-start h2 { color: #fff; }
    .m-start .m-steps { color: #fff; }
    .m-start .m-steps li::marker { color: var(--gold); }
    .m-start .m-cta { flex-direction: column; align-items: stretch; }
    .m-start .m-cta .btn { width: 100%; }
    .m-start .btn-primary { background: var(--gold); color: #1d1f3f; }
    .m-start .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
    .m-start .m-note, .m-start .m-note a { color: #fff; }

    /* The top of every other page: a soft band, centred, with the pigeon above the heading. */
    .m-head { margin: 0 -16px; padding: 32px 20px 40px; text-align: center; justify-items: center; background: color-mix(in srgb, var(--accent) 9%, var(--paper)); border-bottom: 2.5px solid var(--ink); }
    .m-head-text { align-items: center; gap: 16px; }
    .m-head h1 { font-size: clamp(2.1rem, 9.6vw, 2.7rem); line-height: 1.05; letter-spacing: -.04em; max-width: 13ch; margin-inline: auto; }
    .m-head .m-lead { font-size: 1.06rem; line-height: 1.55; max-width: 32ch; }
    .m-head .m-cta { flex-direction: column; align-items: stretch; width: 100%; max-width: 360px; }
    .m-head .m-cta .btn { width: 100%; }
    .m-head-pet { margin: 0 auto -4px; }

    /* Cards with a pigeon: the pigeon beside the heading, so the card isn't a tower. */
    .m-day:has(.m-day-pet) { display: grid; grid-template-columns: 76px 1fr; column-gap: 14px; row-gap: 10px; align-items: center; }
    .m-day:has(.m-day-pet) .m-day-pet { width: 76px; height: 75px; }
    .m-day:has(.m-day-pet) h3 { font-size: 1.3rem; }
    .m-day:has(.m-day-pet) > p, .m-day:has(.m-day-pet) > .m-charge { grid-column: 1 / -1; }

    /* Before a test: a gold band the width of the screen, with the charged pigeon larger. */
    .m-day.m-day-charged { grid-template-columns: 104px 1fr; margin: 10px -16px; padding: 26px 20px 30px; border-width: 2.5px 0; border-radius: 0; box-shadow: none; color: #1d1f3f;
        background-color: var(--gold); background-image: linear-gradient(rgba(29,31,63,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(29,31,63,.07) 1px, transparent 1px); background-size: 24px 24px; }
    .m-day.m-day-charged .m-day-pet { width: 104px; height: 102px; }
    .m-day.m-day-charged h3 { font-family: var(--display); font-size: 1.7rem; letter-spacing: -.035em; line-height: 1.08; }
    .m-day.m-day-charged > p { font-size: 1.04rem; }

    /* The pigeon's section: the finds straight after the heading, with the pigeon standing on them. */
    .m-pigeon { gap: 18px; }
    .m-pigeon > div:first-child { display: contents; }
    .m-pigeon .m-nest { order: 1; margin-top: 92px; }
    .m-pigeon .m-list, .m-pigeon .m-note { order: 2; }
    .m-nest-pet { left: 50%; right: auto; margin-left: -56px; }

    /* The wire is wider than the screen and slides sideways; the pigeon stays put while it does. */
    .m-alt .m-wire { margin: 0 -20px; }
    .m-wire { margin: 0 -16px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
    .m-wire::-webkit-scrollbar { display: none; }
    .m-wire-run { display: grid; width: 900px; padding-top: 46px; }
    .m-wire-line, .m-wire-pet { grid-area: 1 / 1; }
    .m-wire-pet { position: sticky; left: 196px; top: auto; justify-self: start; align-self: start; width: 110px; height: 108px; margin: calc(7cqi - 104px) 0 0 196px; }

    .m-again { margin-inline: auto; }

    /* The screenshots sit on a dark band, the one place the page goes dark. */
    .m-phones { background: #1d1f3f; color: #fff; }
    .m-phones h2 { color: #fff; }
    .m-phones .m-fig figcaption { color: rgba(255,255,255,.82); }
    .m-phones .m-shot { border-color: #0d0e24; box-shadow: 0 6px 0 #0d0e24; }
    .m-phones .m-shots { grid-auto-columns: 70%; }

    /* The menu opens as a sheet over the page, with rows big enough for a thumb. */
    .m-menu[open] nav { position: fixed; top: 76px; left: 0; right: 0; bottom: 0; min-width: 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); gap: 0; border-radius: 0; border-width: 2.5px 0 0; box-shadow: none; background: var(--paper); overflow-y: auto; }
    .m-menu[open] nav a { display: flex; align-items: center; min-height: 58px; padding: 0 4px; font-family: var(--display); font-size: 1.3rem; letter-spacing: -.02em; border-bottom: 1.5px solid var(--soft-line); border-radius: 0; }
    .m-menu summary { min-height: 44px; display: flex; align-items: center; }

    /* Footer links far enough apart to tap */
    .m-foot-cols { gap: 8px 24px; }
    .m-foot-cols nav { gap: 0; }
    .m-foot .m-foot-cols a { display: flex; align-items: center; min-height: 44px; }
    .m-foot { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

    /* A short list of links as cards: one row that scrolls sideways, each card most of the screen wide. */
    .m-cards-scroll { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 14px; scroll-padding: 0 16px; }
    .m-cards-scroll > * { scroll-snap-align: start; }
}

@media (min-width: 761px) {
    .m-hero .m-hero-text { padding-right: 8px; }
    .m-start { background: #5b3ff0; color: #fff; }
    .m-start h2, .m-start .m-steps, .m-start .m-note, .m-start .m-note a { color: #fff; }
    .m-start .m-steps li::marker { color: var(--gold); }
    .m-start .btn-primary { background: var(--gold); color: #1d1f3f; }
    .m-start .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
}

/* Sign up, always in reach on a phone: a bar at the foot of the screen once the page's own button has scrolled away. */
.m-dock { display: none; }
@media (max-width: 760px) {
    .m-dock { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 2px solid var(--soft-line); transform: translateY(110%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s; }
    .m-dock.on { transform: none; visibility: visible; transition: transform .22s ease; }
    .m-dock .btn { width: 100%; min-height: 54px; margin: 0; background: var(--gold); color: #1d1f3f; font-size: 1.12rem; }
}
@media (prefers-reduced-motion: reduce) { .m-dock { transition: none; } }

/* +10 XP over the pigeon after a right answer */
.m-xp { position: absolute; left: 50%; top: -30px; margin-left: -42px; padding: 3px 10px; background: var(--gold); color: #1d1f3f; border: 2.5px solid var(--ink); border-radius: 99px; font-size: .88rem; font-weight: 700; white-space: nowrap; animation: m-pop .45s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes m-pop { from { transform: translateY(10px) scale(.5); opacity: 0; } }

/* The question from the top of the page, back again for anyone who missed it */
.m-again { width: 100%; max-width: 440px; }
.m-again:not([hidden]) { display: flex; flex-direction: column; gap: 12px; }
.m-again-why { font-weight: 600; }
/* On a wide screen the question sits beside the heading, and why it is here is said under the heading. */
@media (min-width: 761px) {
    .m-alt:has(> .m-again:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 18px 44px; align-items: start; }
    .m-alt:has(> .m-again:not([hidden])) > * { grid-column: 1; }
    .m-alt:has(> .m-again:not([hidden])) > .m-wire, .m-alt:has(> .m-again:not([hidden])) > .m-note { grid-column: 1 / -1; }
    .m-alt > .m-again:not([hidden]) { display: contents; }
    .m-alt > .m-again > .m-again-why { grid-column: 1; }
    .m-alt > .m-again > .m-q { grid-column: 2; grid-row: 1 / span 3; }
}
@media (max-width: 760px) { .m-again-why { text-align: center; } }
.m-again .m-q { animation: m-pop .45s cubic-bezier(.3, 1.3, .5, 1) both; }

/* Fourteen days up to a test. They fill one after another when the card comes on screen (site.js). */
.m-charge { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.m-charge span { flex: 1; height: 14px; border: 2.5px solid #1d1f3f; border-radius: 99px; background: #5b3ff0; transition: background-color .2s linear calc(var(--i) * 70ms); }
.m-charge.wait span { background: #fff; transition: none; }
.m-charge b { margin-left: 4px; padding: 2px 10px; border: 2.5px solid #1d1f3f; border-radius: 99px; background: #fff; color: #1d1f3f; font-size: .8rem; }

/* The pigeon stands on the card of things it has brought back. Seven days in a row is the wide one. */
.m-nest { position: relative; margin-top: 64px; }
.m-nest-pet { position: absolute; right: 26px; top: -105px; width: 112px; height: 110px; }
.m-find-big { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 12px; padding: 10px 14px; background: var(--gold); color: #1d1f3f; font-size: .88rem; text-align: left; }
.m-find-big .find-icon { width: 2.3rem; height: 2.3rem; }
.m-find-big strong { display: block; font-size: 1rem; }

/* Getting started: the four steps, numbered large */
.m-start .m-steps { padding: 0; list-style: none; counter-reset: step; gap: 18px; }
.m-start .m-steps li { counter-increment: step; position: relative; min-height: 44px; padding-left: 58px; }
.m-start .m-steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 44px; font-family: var(--display); font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -.04em; text-align: center; color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
    .m-xp, .m-again .m-q { animation: none; }
    .m-charge span { transition: none; }
}

/* The opening on a wide screen. The purple holds only the headline, the buttons and what it costs, so the
   whole panel fits on a screen. The question hangs over its bottom edge with the pigeon standing on it,
   and what the app is sits on paper underneath, where a paragraph is easier to read.
   Rows: 1 the headline, 2 the buttons, 3 what it costs (the purple covers these), 4 and 5 the rest. */
@media (min-width: 761px) {
    .m-hero { grid-template-areas: none; grid-template-rows: auto auto 1fr auto auto; column-gap: 48px; row-gap: 0; align-items: start; padding: 56px 48px 0; }
    .m-hero-text { display: contents; }
    .m-hero::before { position: relative; inset: auto; grid-area: 1 / 1 / 4 / 3; align-self: stretch; margin: -56px -48px -44px; }
    .m-hero-title { grid-area: 1 / 1; }
    .m-hero .m-cta { grid-area: 2 / 1; margin-top: 28px; }
    .m-hero .m-free { grid-area: 3 / 1; margin-top: 14px; color: #fff; font-weight: 600; }
    .m-hero > .m-demo-pet { grid-area: 1 / 2; align-self: start; margin: 0; }
    /* The negative margin keeps the question from stretching the purple: it is what hangs below the edge. */
    .m-hero .m-demo { grid-area: 1 / 2 / 4 / 3; align-self: start; margin: 166px 0 -130px; }
    .m-hero .m-lead { grid-area: 4 / 1 / 6 / 2; margin-top: 88px; color: var(--text); }
    .m-hero .m-small:not(.m-free) { grid-column: 2; margin-top: 14px; color: var(--muted); }
    .m-hero .m-free + .m-small { grid-row: 4; margin-top: 180px; }
    .m-hero .m-free + .m-small + .m-small { grid-row: 5; }
    .m-hero .m-hero-text p a { color: var(--accent); text-decoration-color: currentColor; text-decoration-thickness: auto; }
}

/* A set of points: a ruled list, each with its heading beside what there is to say about it.
   These used to be a grid of identical cards. A card is kept for a thing you can open or choose. */
.m-points { display: flex; flex-direction: column; max-width: 58em; border-top: 2.5px solid var(--ink); }
.m-point { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 6px 32px; align-items: start; padding: 16px 0; border-bottom: 1.5px solid var(--soft-line); }
.m-point > h3, .m-point > .m-card-tag { grid-column: 1; }
.m-point > :not(h3):not(.m-card-tag) { grid-column: 2; }
.m-point .m-card-more { margin-top: 0; padding-top: 0; }

/* A term and what it means, where a bullet used to start with a bold label */
.m-terms { margin: 0; display: flex; flex-direction: column; max-width: 46em; }
.m-terms > div { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr); gap: 4px 24px; padding: 10px 0; border-bottom: 1.5px solid var(--soft-line); }
.m-terms > div:last-child { border-bottom: 0; }
.m-terms dt { font-weight: 700; }
.m-terms dd { margin: 0; }

/* The guides, as a list to read down */
.m-guides { margin: 0; padding: 0; list-style: none; max-width: 58em; border-top: 2.5px solid var(--ink); }
.m-guides li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 6px 32px; align-items: baseline; padding: 18px 0; border-bottom: 1.5px solid var(--soft-line); }
.m-section .m-guides h3 { font-size: 1.3rem; line-height: 1.2; letter-spacing: -.02em; text-align: left; }
/* The guides page groups them under a heading each, closer together than whole sections */
.m-guide-group + .m-guide-group { margin-top: 0; padding-top: 0; }
.m-guide-group > h2 { margin-bottom: 14px; }
.m-main .m-guides a { color: var(--text); text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.m-guides p { color: var(--muted); }

@media (max-width: 760px) {
    .m-point, .m-terms > div, .m-guides li { grid-template-columns: minmax(0, 1fr); }
    .m-point > :not(h3):not(.m-card-tag) { grid-column: 1; }
    .m-point { padding: 14px 0; }
}
