/* The blog index, the posts and the 8 free habits page. Loaded after site.css, on those pages only.
 *
 * The same system as the app's landing page: neo-brutalist blocks (3px ink outline, hard offset
 * shadow, flat candy colour), Archivo Black poster lines, Baloo 2 for figures and card titles, Space
 * Mono pills, and abstract poster art where a page wants a picture (art/*.svg, drawn by
 * tools/blog-art/make.py from the app's HundrdPosterArt). No photos, no emoji, no gradients.
 *
 * Every topic carries its own colour pair, set by a t-<topic> class on the page or on a card:
 *   --topic      a tag swatch (tokens/colors.css --tag-*), the fill behind ink: chips, tiles, ticks
 *   --topic-art  that topic's poster
 * Ink on a swatch is always #141013. The swatches are light in both themes, so it holds in dark too. */

:root {
    --topic: #fee18d;              /* --tag-butter, the default */
    --topic-art: url("/art/blog.svg");
    --poster-ink: #141013;
    --poster-paper: #fffdf5;
    --poster-body: #b9b2be;        /* --poster-ink-body-text */
    --shadow-sm: 3px 4px 0 var(--shadow);
    --shadow-md: 5px 6px 0 var(--shadow);
    --shadow-lg: 7px 8px 0 var(--shadow);
}

.t-sleep    { --topic: #cdb6e8; --topic-art: url("/art/sleep.svg"); }    /* --tag-lilac */
.t-steps    { --topic: #79c6e8; --topic-art: url("/art/steps.svg"); }    /* --tag-sky */
.t-strength { --topic: #f6a98a; --topic-art: url("/art/strength.svg"); } /* --tag-coral */
.t-fitness  { --topic: #cfe97e; --topic-art: url("/art/fitness.svg"); }  /* --tag-lime */
.t-friends  { --topic: #f6a9c2; --topic-art: url("/art/friends.svg"); }  /* --tag-pink */
.t-food     { --topic: #a9d9a9; --topic-art: url("/art/food.svg"); }     /* --tag-mint */
.t-balance  { --topic: #f7c98b; --topic-art: url("/art/balance.svg"); }  /* --tag-peach */
.t-fibre    { --topic: #57b6a8; --topic-art: url("/art/fibre.svg"); }    /* --tag-teal */
.t-basics   { --topic: #fee18d; --topic-art: url("/art/basics.svg"); }   /* --tag-butter */
.t-habits   { --topic: #fee18d; --topic-art: url("/art/habits.svg"); }   /* the one-pager: every colour */

/* ---- Shared pieces ---- */

/* A poster: the topic's art in an outlined, shadowed frame. Decorative, so it is a background. */
.poster {
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--poster-ink) var(--topic-art) center / cover no-repeat;
    box-shadow: var(--shadow-md);
}

/* The topic pill: Space Mono caps on the topic swatch, the landing page's tag. */
.chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.2rem 0.75rem;
    border: 3px solid var(--line);
    border-radius: 999px;
    background: var(--topic);
    box-shadow: 2px 2px 0 var(--shadow);
    color: #141013;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
}

a.chip:hover {
    background: var(--yellow);
}

.meta {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 0.9rem;
    margin: 0 0 1rem;
}

/* The page's poster line: the heading face at marketing size, the landing headline's tracking. */
.display {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 8vw, 4.6rem);
    line-height: 0.96;
    letter-spacing: -0.03em;
}

/* ---- Wide pages ---- */

.blog-index .top,
.blog-index main,
.blog-index footer,
.habits-page .top,
.habits-page footer {
    max-width: 72rem;
}

/* ---- Blog index ---- */

.blog-hero {
    display: grid;
    gap: 2rem;
    margin: 0 0 3.5rem;
}

.blog-hero .lede {
    max-width: 34rem;
    color: var(--muted);
}

/* The landing page's poster pane: ink ground, the art, and two lines in reversed type over it. */
.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 20rem;
    padding: 1.5rem;
    border: 3px solid var(--line);
    border-radius: 36px; /* --radius-xxl: expressive hero tile */
    background: var(--poster-ink);
    box-shadow: var(--shadow-lg);
    color: var(--poster-paper);
    overflow: hidden;
}

.hero-panel .poster {
    flex: 1;
    min-height: 10rem;
    margin: 0 0 1.25rem;
    border-color: var(--poster-ink);
    border-radius: 20px;
    box-shadow: none;
}

.hero-panel strong {
    display: block;
    font-family: var(--font-head);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 400;
    line-height: 1.05;
    text-transform: uppercase;
}

.hero-panel span {
    display: block;
    margin-top: 0.5rem;
    color: var(--poster-body);
    font-size: 1rem;
    line-height: 1.45;
}

.section-title {
    margin: 0 0 1.25rem;
    font-size: clamp(1.4rem, 3.5vw, 1.9rem);
}

/* The one-pager, as the index's lead story: a butter slab with its art beside the words. */
.feature {
    display: grid;
    margin: 0 0 3.5rem;
    border: 3px solid var(--line);
    border-radius: 36px;
    background: var(--yellow);
    box-shadow: var(--shadow-lg);
    color: #141013;
    overflow: hidden;
}

.feature .poster {
    min-height: 12rem;
    border: 0;
    border-bottom: 3px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.feature-body {
    padding: 1.5rem 1.5rem 1.75rem;
}

.feature-body h2 {
    margin: 0.9rem 0 0.5rem;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1;
}

.feature-body p {
    max-width: 30rem;
    margin: 0 0 1.25rem;
    font-size: 18px;
    line-height: 26px;
}

.feature .chip {
    background: var(--poster-paper);
}

.feature .btn {
    background: var(--poster-ink);
    color: var(--poster-paper);
}

.feature .btn:hover {
    background: #2b2329;
}

.posts {
    display: grid;
    gap: 1.75rem;
    margin: 0 0 2.5rem;
    padding: 0;
    list-style: none;
}

.posts > li {
    display: flex;
}

.post-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--ink);
    text-decoration: none;
    overflow: hidden;
    transition: transform 420ms var(--spring-fast), box-shadow 90ms var(--ease-out);
}

.post-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.post-link:active {
    transform: translate(4px, 4px);
    box-shadow: 1px 1px 0 var(--shadow);
}

.post-link .poster {
    height: 9.5rem;
    border: 0;
    border-bottom: 3px solid var(--line);
    border-radius: 0;
    box-shadow: none;
}

.post-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.1rem 1.25rem 1.3rem;
}

.post-link h2 {
    margin: 0 0 0.5rem;
}

.post-link p {
    margin: 0;
    color: var(--muted);
}

.post-link .more {
    margin-top: auto;
    padding-top: 1rem;
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
    text-decoration-color: var(--topic);
}

/* Closing calls to action: two slabs side by side. */
.ctas {
    display: grid;
    gap: 1.75rem;
    margin: 1rem 0 0;
}

.ctas .card {
    margin: 0;
}

.card.mint {
    background: var(--green);
    color: #141013;
}

.card.mint .btn {
    background: var(--poster-paper);
}

/* The app card: the landing page's poster pane, as a card. */
.card.ink {
    position: relative;
    padding-top: 7.5rem;
    border-radius: 36px;
    background: var(--poster-ink) url("/art/blog.svg") center top / 100% 6rem no-repeat;
    color: var(--poster-paper);
    overflow: hidden;
}

.card.ink::before {
    content: "";
    position: absolute;
    top: 6rem;
    left: 0;
    right: 0;
    border-top: 3px solid var(--line);
}

.card.ink p,
.card.ink .small {
    color: var(--poster-body);
}

.card.ink .btn.alt {
    background: var(--poster-paper);
    color: #141013;
}

@media (min-width: 40rem) {
    .posts,
    .ctas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    }

    .feature .poster {
        border-right: 3px solid var(--line);
        border-bottom: 0;
    }

    .feature-body {
        padding: 2.25rem;
    }
}

@media (min-width: 56rem) {
    .blog-hero {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: stretch;
        gap: 3rem;
    }

    .blog-hero > div:first-child {
        align-self: center;
    }

}

/* Four across, the landing page's "how it works" row: eight posts make two full rows, and a page of
   twelve makes three. Never three across, which leaves two cards over. */
@media (min-width: 68rem) {
    .posts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

/* ---- A post ----
 *
 * A magazine spread in the landing page's poster language. Top to bottom:
 *   a sticky bar with a reading-progress line · a full-bleed hero in the topic's poster colour · the
 *   ink stat strip (the post's figures, first thing after the intro) · contents beside the reading
 *   column · "What you can use" as numbered tiles across the full width · the two closing cards ·
 *   sources · more posts · the slogan footer.
 * Full-bleed bands span the window; their content sits in a .wrap of the page's 72rem measure.
 * Colour comes in blocks (hero, strip, sticker, doubt cards, verdict, tiles), so the long reading
 * column between them can stay quiet. */

.t-strength { --hero: #ff7a5c; } /* --poster-tangerine */
.t-sleep    { --hero: #9b6bf0; } /* --poster-violet */
.t-fitness  { --hero: #35b6f2; } /* --poster-azure */
.t-steps    { --hero: #35b6f2; }
.t-friends  { --hero: #ff5fa2; } /* --poster-hot-pink */
.t-food     { --hero: #6cff9e; } /* --poster-acid-green */
.t-fibre    { --hero: #6cff9e; }
.t-balance  { --hero: #ffd429; } /* --poster-electric-yellow */
.t-basics   { --hero: #ffd429; }

body.post {
    padding: 0;
}

.post main {
    max-width: none;
}

.post .wrap {
    max-width: 72rem;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1.25rem;
    padding-left: 1.25rem;
}

/* The bar: pinned, opaque, a hairline under it and the reading line above that. */
.post .top {
    position: sticky;
    top: 0;
    z-index: 10;
    max-width: none;
    margin: 0;
    padding: 0.6rem max(1.25rem, calc((100% - 72rem) / 2 + 1.25rem));
    border-bottom: 3px solid var(--line);
    background: var(--bg);
}

.post .top nav {
    align-items: center;
    gap: 0.75rem;
}

.post .top nav a.pill {
    padding: 0.3rem 0.8rem;
    border: 3px solid var(--line);
    border-radius: 999px;
    background: var(--yellow);
    color: #141013;
    text-decoration: none;
}

.post .top nav a.pill,
.post .top nav a.open {
    white-space: nowrap;
}

.post .top nav a.open {
    padding: 0.45rem 1rem;
    border: 3px solid var(--line);
    border-radius: 999px;
    background: var(--yellow);
    box-shadow: var(--shadow-sm);
    color: #141013;
    text-decoration: none;
}

.read-progress {
    position: absolute;
    right: 0;
    bottom: -3px;
    left: 0;
    height: 3px;
    pointer-events: none;
}

.read-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--green);
}

/* The hero: a slab of the topic's poster colour. Ink on every one of them holds 4.5:1 or better. */
.post-hero {
    padding: 3.5rem 0 3.75rem;
    border-bottom: 3px solid var(--line);
    background: var(--hero, var(--yellow));
    color: #141013;
}

.post-hero .chips {
    margin-bottom: 1.4rem;
}

.post-hero .chip {
    background: var(--poster-paper);
}

.post-hero .meta {
    color: #141013;
}

.post-hero h1 {
    max-width: 50rem;
    margin: 0 0 1.25rem;
    font-size: clamp(2.2rem, 6.5vw, 4.4rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
}

.post-hero .lede {
    max-width: 36rem;
    margin: 0;
    font-size: 19px;
    line-height: 28px;
}

/* The stat strip: the post's figures on ink, right after the intro. Each figure sizes to its own
   column (cqi), so a long one ("139,691", "6,000–8,000") never runs into the next. */
.stat-strip {
    padding: 2.5rem 0 2.75rem;
    border-bottom: 3px solid var(--line);
    background: var(--poster-ink);
    color: var(--poster-paper);
}

.stat-strip ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stat-strip li {
    container-type: inline-size;
    padding-top: 1rem;
    border-top: 2px solid #4a4248;
    color: var(--poster-body);
    font-size: 15px;
    line-height: 21px;
}

.stat-strip strong {
    display: block;
    margin: 0 0 0.6rem;
    color: var(--poster-paper);
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-size: clamp(1.9rem, 21cqi, 4.2rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 0.95;
}

.stat-strip li:nth-child(4n + 1) strong { color: var(--hero, var(--yellow)); }

.stat-strip sup a {
    display: inline-block;
    margin-left: 0.2em;
    padding: 0.1em 0.35em;
    border: 2px solid var(--poster-paper);
    border-radius: 6px;
    color: var(--poster-paper);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

/* ---- Contents + reading column ---- */

.post-layout {
    display: grid;
    gap: 2.5rem;
    padding-top: 3rem;
}

.toc-col {
    display: none;
}

.prose {
    min-width: 0;
    max-width: 42rem;
    font-size: 18px;
    line-height: 28px;
}

.prose p,
.prose li {
    max-width: none;
}

.prose > p {
    margin: 0 0 1.1rem;
}

/* Section heads: a mono number over the poster line. The number is the page's, in data-n, so the
   contents (built from the heading's text) never pick it up. */
.prose > h2,
.use-section > h2 {
    margin: 4rem 0 1.1rem;
    font-size: clamp(1.7rem, 4.5vw, 2.4rem);
    line-height: 1.02;
    letter-spacing: -0.01em;
    scroll-margin-top: 5.5rem;
}

.prose > h2:first-child {
    margin-top: 0;
}

.prose > h2[data-n]::before,
.use-section > h2[data-n]::before {
    content: attr(data-n);
    display: block;
    margin: 0 0 0.6rem;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.prose > h3 {
    margin: 2rem 0 0.5rem;
    font-size: 22px;
    line-height: 26px;
}

/* Raised by position, not by vertical-align, so a line carrying a mark keeps the column's spacing. */
.prose sup {
    position: relative;
    top: -0.45em;
    vertical-align: baseline;
    line-height: 0;
}

.prose sup a {
    display: inline-block;
    min-width: 1.35em;
    margin-left: 0.1em;
    padding: 0.2em 0.3em;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--yellow);
    color: #141013;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
}

.prose ul,
.prose ol {
    margin: 0 0 1.25rem;
    padding-left: 1.3rem;
}

.prose li {
    margin: 0.5rem 0;
}

/* Key figures inside a section: stat tiles, the figure in Baloo 2 like the app's StatCard. */
.prose .zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2rem;
    padding: 0;
    list-style: none;
}

.prose .zones li {
    margin: 0;
    padding: 1rem 1.1rem 1.1rem;
    border: 3px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--muted);
    font-size: 15px;
    line-height: 21px;
}

.prose .zones strong {
    display: block;
    margin: 0 0 0.35rem;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
}

.prose .zones li:nth-child(odd) {
    background: var(--topic);
    color: #3b3337;
}

.prose .zones li:nth-child(odd) strong {
    color: #141013;
}

/* A pull stat: the paragraph's figure lifted onto a tilted hot-pink sticker beside it. The sticker
   repeats the sentence's own number, so it is hidden from screen readers. */
.prose .pull {
    display: grid;
    gap: 1rem;
    align-items: center;
    margin: 1.75rem 0 2rem;
    padding: 1.25rem;
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--poster-paper);
    box-shadow: var(--shadow-md);
    color: #141013;
}

.prose .pull p {
    margin: 0;
    font-size: 16px;
    line-height: 24px;
}

.sticker {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 0.6rem;
    padding: 0.55rem 1.1rem 0.55rem 0.9rem;
    border: 3px solid var(--line);
    border-radius: 14px;
    background: #ff5fa2; /* --poster-hot-pink */
    box-shadow: var(--shadow-sm);
    color: #141013;
    transform: rotate(-4deg);
}

.sticker b {
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    white-space: nowrap;
}

.sticker small {
    max-width: 6.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

/* The doubts: one lilac card each, numbered on a pill. */
.prose .doubt {
    margin: 0 0 1rem;
    padding: 1rem 1.2rem 1.1rem;
    border: 3px solid var(--line);
    border-radius: 20px;
    background: #e3d5f3; /* --tag-lilac, lightened for a long read */
    box-shadow: var(--shadow-md);
    color: #141013;
}

.prose .doubt h3 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    margin: 0 0 0.4rem;
    font-size: 20px;
    line-height: 24px;
}

.prose .doubt h3 .tag {
    padding: 0.2rem 0.55rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--poster-paper);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.prose .doubt p {
    margin: 0 0 0.6rem;
    font-size: 16px;
    line-height: 24px;
}

.prose .doubt > :last-child {
    margin-bottom: 0;
}

/* "Our reading": the verdict, in the app's mint. */
.prose .verdict {
    margin: 2rem 0 0;
    padding: 1.3rem 1.5rem 1.4rem;
    border: 3px solid var(--line);
    border-radius: 24px;
    background: #22d97f; /* --accent-secondary, the same in both themes so ink holds */
    box-shadow: var(--shadow-md);
    color: #141013;
}

.prose .verdict .meta {
    margin: 0 0 0.4rem;
    color: #141013;
}

.prose .verdict p:last-child {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 27px;
}

/* The coach, proud, at the verdict's left. Decoration (aria-hidden), so the text reads the same. */
.prose .verdict:has(.verdict-mascot) {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 0.9rem;
    padding-left: 1rem;
}

.prose .verdict:has(.verdict-mascot) > :not(.verdict-mascot) {
    grid-column: 2;
}

.prose .verdict .verdict-mascot {
    grid-row: 1 / span 9;
    align-self: start;
    width: 56px;
    height: 56px;
    margin-top: 0.1rem;
}

.prose .verdict .verdict-mascot img {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- What you can use: numbered tiles across the full width ---- */

.use-section > h2 {
    margin-top: 4.5rem;
}

.use-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 1.5rem;
    padding: 0;
    list-style: none;
}

.use-grid li {
    padding: 1.1rem 1.2rem 1.3rem;
    border: 3px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
    color: var(--ink);
}

.use-grid li:nth-child(odd) {
    background: var(--yellow);
    color: #141013;
}

.use-grid .n {
    display: block;
    margin: 0 0 0.5rem;
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.use-grid strong {
    display: block;
    margin: 0 0 0.45rem;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    line-height: 23px;
}

.use-grid p {
    margin: 0;
    font-size: 15px;
    line-height: 21px;
}

.use-grid li:not(:nth-child(odd)) p {
    color: var(--muted);
}

.use-section > p {
    max-width: 42rem;
    font-size: 18px;
    line-height: 28px;
}

/* ---- The closing cards ---- */

.end-cards {
    display: grid;
    gap: 2rem;
    margin-top: 4rem;
}

.end-cards .card {
    position: relative;
    margin: 0;
    padding: 2rem 1.5rem;
    border-radius: 36px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.end-cards .card h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 4vw, 2.3rem);
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

.end-cards .card p {
    max-width: 30rem;
}

/* The quiz: ink, with the topic's art as a disc breaking out of the corner. */
.end-cards .quiz {
    padding-bottom: 9rem;
    background: var(--poster-ink);
    color: var(--poster-paper);
}

.end-cards .quiz p {
    color: var(--poster-body);
}

.end-cards .art-disc {
    position: absolute;
    right: -3rem;
    bottom: -4rem;
    width: 14rem;
    height: 14rem;
    border: 3px solid var(--line);
    border-radius: 50%;
    background: var(--poster-ink) var(--topic-art) center / cover no-repeat;
}

/* The app: butter on the left, the art on the right. */
.end-cards .app {
    display: grid;
    padding: 0;
    background: var(--yellow);
    color: #141013;
}

.end-cards .app .app-body {
    padding: 2rem 1.5rem;
}

.end-cards .app .art {
    min-height: 10rem;
    border-top: 3px solid var(--line);
    background: var(--poster-ink) var(--topic-art) center / cover no-repeat;
}

/* Three coaches standing along the bottom of the art. */
.end-cards .app .art {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.end-cards .app .app-crew {
    display: flex;
    align-items: flex-end;
    margin-bottom: -6px;
}

.end-cards .app .app-crew img {
    display: block;
    width: clamp(76px, 24vw, 112px);
    height: auto;
}

.end-cards .app .app-crew img + img {
    margin-left: -0.6rem;
}

/* The middle one is the proud one, so it stands a little taller. */
.end-cards .app .app-crew img:nth-child(2) {
    width: clamp(88px, 28vw, 132px);
}

.end-cards .app .btn {
    background: var(--poster-ink);
    color: var(--poster-paper);
}

.end-cards .app .btn.alt {
    background: var(--poster-paper);
    color: #141013;
}

.end-cards .app .small {
    color: #3b3337;
}

/* ---- Sources ---- */

.sources {
    display: grid;
    gap: 1.5rem;
    margin-top: 4rem;
}

.sources h2 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
}

.sources .disclaimer {
    margin: 0;
    padding: 0.9rem 1rem;
    border: 3px solid var(--line);
    border-radius: 16px;
    background: var(--well);
}

.sources .refs {
    margin: 0;
    padding: 0;
    border-top: 3px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
    list-style: none;
    counter-reset: ref;
}

.sources .refs li {
    position: relative;
    margin: 0;
    padding: 0.85rem 0 0.85rem 2.6rem;
    border-bottom: 2px solid var(--well);
    overflow-wrap: anywhere;
    counter-increment: ref;
    scroll-margin-top: 5.5rem;
}

.sources .refs li::before {
    content: counter(ref);
    position: absolute;
    top: 0.75rem;
    left: 0;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--yellow);
    color: #141013;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
}

.sources .refs li:target {
    background: var(--well);
    color: var(--ink);
}

.sources .refs a {
    color: var(--ink);
    font-weight: 700;
}

/* ---- More posts ---- */

.more {
    margin-top: 4.5rem;
}

.more-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1.5rem;
}

.more-head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.3rem);
}

.more-head a {
    padding: 0.45rem 1rem;
    border: 3px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-weight: 800;
    text-decoration: none;
}

.more-grid {
    display: grid;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.more-grid a {
    display: block;
    color: var(--ink);
    text-decoration: none;
}

.more-grid .cover {
    position: relative;
    height: 11rem;
    margin: 0 0 0.75rem;
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--hero, var(--yellow));
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform 420ms var(--spring-fast), box-shadow 90ms var(--ease-out);
}

.more-grid a:hover .cover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.more-grid .cover::after {
    content: "";
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    bottom: -3px;
    width: 46%;
    border: 3px solid var(--line);
    border-radius: 999px 999px 0 0;
    background: var(--poster-ink) var(--topic-art) center / cover no-repeat;
}

.more-grid .chip {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    min-height: 26px;
    background: var(--poster-paper);
    font-size: 0.65rem;
}

/* The cover's coach, standing in the arch's doorway with its feet past the cover's edge. */
.more-grid .cover-mascot {
    position: absolute;
    z-index: 1;
    right: calc(1.1rem + 23%);
    bottom: -10px;
    width: clamp(72px, 34%, 108px);
    height: auto;
    transform: translateX(50%);
}

.more-grid .meta {
    display: block;
    margin: 0 0 0.25rem;
}

.more-grid b {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 23px;
}

.more-grid a:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 4px;
}

/* ---- The slogan footer ---- */

.post footer {
    max-width: none;
    margin: 5rem 0 0;
    padding: 4rem 0 2.5rem;
    border-top: 3px solid var(--line);
    background: var(--poster-ink);
    color: var(--poster-body);
}

.post footer .slogan {
    margin: 0 0 2.5rem;
    color: var(--poster-paper);
    font-family: var(--font-head);
    font-size: clamp(3rem, 12vw, 7rem);
    line-height: 0.92;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.post footer .slogan span {
    color: #6cff9e; /* --poster-acid-green */
}

/* The whole family under the slogan, on a paper strip: their outlines are ink, and on the ink
   footer they would vanish. Eight across at every width, so they shrink rather than wrap. */
.post footer .mascot-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 88px));
    justify-content: space-between;
    gap: 0.25rem;
    max-width: 52rem;
    margin: -0.5rem 0 2.5rem;
    padding: 0.6rem 0.9rem 0.4rem;
    border: 3px solid var(--line);
    border-radius: 24px;
    background: var(--poster-paper);
    box-shadow: 4px 4px 0 #000;
}

.post footer .mascot-row img {
    display: block;
    width: 100%;
    height: auto;
}

.post footer .foot-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 2px solid #4a4248;
}

.post footer a {
    color: var(--poster-paper);
    font-weight: 700;
}

.post footer .meta {
    color: var(--poster-body);
}

/* ---- Wider windows ---- */

@media (min-width: 40rem) {
    .post-hero {
        padding: 5rem 0 5.5rem;
    }

    .prose .pull {
        grid-template-columns: max-content minmax(0, 1fr);
        gap: 1.5rem;
        padding: 1.5rem 1.75rem;
    }

    .end-cards .quiz {
        padding: 2.5rem 18rem 2.5rem 2.5rem;
    }

    .end-cards .art-disc {
        top: 50%;
        right: -2rem;
        bottom: auto;
        width: 16rem;
        height: 16rem;
        transform: translateY(-35%);
    }

    .end-cards .app {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    }

    .end-cards .app .app-body {
        padding: 2.5rem;
    }

    .end-cards .app .art {
        border-top: 0;
        border-left: 3px solid var(--line);
    }

    .more-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 56rem) {
    .stat-strip ul {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sources {
        grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
        gap: 3rem;
    }
}

@media (min-width: 64rem) {
    .post-layout {
        grid-template-columns: minmax(0, 14rem) minmax(0, 42rem);
        gap: 4rem;
        padding-top: 4rem;
    }

    .toc-col {
        display: block;
    }

    .toc-col > div {
        position: sticky;
        top: 6rem;
    }
}

/* Contents, built by /blog.js from the headings so it is never out of step with them. */
.toc {
    display: none;
}

.toc.ready {
    display: block;
}

.toc p {
    margin: 0 0 0.75rem;
}

.toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.toc li {
    counter-increment: toc;
}

.toc a {
    display: flex;
    gap: 0.6rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.toc a::before {
    content: counter(toc, decimal-leading-zero);
    flex: none;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.7;
}

.toc a:hover,
.toc a[aria-current="true"] {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-decoration-color: var(--hero, var(--topic));
    text-underline-offset: 4px;
}

/* The quiz, small, under the contents. */
.quiz-mini {
    display: block;
    margin-top: 1.5rem;
    padding: 0.9rem 1rem 1rem;
    border: 3px solid var(--line);
    border-radius: 18px;
    background: var(--yellow);
    box-shadow: var(--shadow-md);
    color: #141013;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
}

.quiz-mini span {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.45rem 1rem;
    border: 3px solid var(--line);
    border-radius: 999px;
    background: var(--poster-ink);
    color: var(--poster-paper);
}

.quiz-mini:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

@media (max-width: 39.99rem) {
    .hero-panel {
        min-height: 0;
        padding: 1.1rem;
        border-radius: 26px;
    }

    .hero-panel .poster {
        flex: none;
        height: 7rem;
        min-height: 0;
    }

    /* The bar keeps the brand and the app. The quiz is in the closing card, and the hero carries
       its own "← Blog". */
    .post .top nav a:first-child,
    .post .top nav a.pill {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .more-grid .cover {
        transition: none;
    }

    .more-grid a:hover .cover {
        transform: none;
    }
}

@media print {
    .post .top,
    .read-progress,
    .toc-col,
    .end-cards,
    .more,
    .post footer {
        display: none !important;
    }

    .post-hero,
    .stat-strip,
    .sticker,
    .doubt,
    .verdict,
    .use-grid li {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---- The 8 free habits ---- */

.habits-page main {
    max-width: 52rem;
}

.habits-hero .lede,
.habits-hero .small {
    max-width: 44rem;
}

/* Two across on a wide window, so the eight read as a set rather than a scroll. Print keeps its own
   two-column sheet (site.css). */
@media screen and (min-width: 72rem) {
    .habits-page main {
        max-width: 72rem;
    }

    .habits-page .habits {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .habits-page .habit {
        margin: 0;
    }
}

.habits-hero .poster {
    height: clamp(8rem, 20vw, 12rem);
    margin: 0 0 2rem;
    border-radius: 36px;
    box-shadow: var(--shadow-lg);
}

.habits-page .display {
    font-size: clamp(2.4rem, 8vw, 4rem);
}

.habit {
    overflow: hidden;
}

.habit::before {
    background: var(--topic);
}

.habit:nth-child(even)::before {
    background: var(--topic);
}

.habit .step {
    background: var(--topic);
    color: #141013;
}

.habit .step .label {
    color: #3b3337;
}

.habit .read {
    text-decoration-color: var(--topic);
}

/* A strip of the topic's art along the card's right edge, on a wide window. */
@media (min-width: 40rem) {
    .habit {
        padding-right: 9.5rem;
    }

    .habit::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 7.5rem;
        border-left: 3px solid var(--line);
        background: var(--poster-ink) var(--topic-art) center / cover no-repeat;
    }
}

@media print {
    .poster,
    .hero-panel,
    .toc,
    .habit::after {
        display: none !important;
    }

    /* The sheet sits a few px from a second page, so print trims its padding to keep one. */
    .habit {
        padding-top: 0.4rem;
        padding-right: 0.6rem !important;
        padding-bottom: 0.4rem;
    }

    .display,
    .habits-page .display {
        font-size: 20pt;
    }

    .habits-hero .chips {
        display: none;
    }

    /* Printers drop backgrounds, and reversed type with no ground prints as nothing. */
    .card.ink {
        padding: 0.4rem 0.7rem;
        background: #fff;
        color: #141013;
    }

    .card.ink::before {
        display: none;
    }

    .card.ink p,
    .card.ink .small {
        color: #595052;
    }

    .habit::before,
    .habit .step,
    .chip {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

@media (prefers-reduced-motion: reduce) {
    .post-link:hover,
    .post-link:active {
        transform: none;
    }
}

a.feature {
    text-decoration: none;
    transition: transform 420ms var(--spring-fast), box-shadow 90ms var(--ease-out);
}

a.feature:hover {
    transform: translateY(-3px);
    box-shadow: 9px 11px 0 var(--shadow); /* --shadow-xl */
}

a.feature:active {
    transform: translate(4px, 4px);
    box-shadow: 1px 1px 0 var(--shadow);
}

a.feature:focus-visible,
.chip:focus-visible,
.toc a:focus-visible {
    outline: 3px solid var(--ink); /* keyboard focus: ink, never a coloured glow (DESIGN-ALIGNMENT D4) */
    outline-offset: 3px;
}

/* The date line stays one phrase; it wraps under the chip rather than mid-phrase. */
.chips .meta {
    white-space: nowrap;
}

/* The footer's social tiles keep the site's own surface and ink on the slogan band. */
.post footer .social a {
    color: var(--ink);
}
