/*
 * Manasik Hajj — public website (landing, legal pages, support, account deletion, group invitation).
 *
 * The look is the app's design system, "Bento Terang" (manasik-hajj-flutter/DESIGN.md): warm paper,
 * ink type, one marigold accent, outlined cards with a 10 px radius, pills for buttons. No gradients,
 * no shadows. Plain CSS on purpose: the server has no build step.
 */

/* ------------------------------------------------------------------ fonts */

@font-face {
    font-family: "Sora";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url("/fonts/site/sora-bold.woff2") format("woff2");
}

@font-face {
    font-family: "Outfit";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("/fonts/site/outfit-regular.woff2") format("woff2");
}

@font-face {
    font-family: "Outfit";
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url("/fonts/site/outfit-semibold.woff2") format("woff2");
}

/* ----------------------------------------------------------------- tokens */

:root {
    color-scheme: light;

    --page: #F5F0E6;
    --card: #FFFFFF;
    --outline: #151515;
    --divider: #E7E1D6;
    --ink: #151515;
    --muted: #6F6A62;
    --accent: #F2B412;

    /* The loud card, and the second loud card. */
    --strong-bg: #151515;
    --strong-fg: #FFFFFF;
    --strong-soft: #C9C4BA;
    --strong-label: #F2B412;
    --strong-line: #3A3A3A;
    --highlight-bg: #F2B412;
    --highlight-fg: #151515;
    --highlight-soft: #3B2C04;

    --button-bg: #151515;
    --button-fg: #FFFFFF;
    --focus: #151515;

    /* Tiles that carry a screenshot keep the colour baked into the picture, in both themes. */
    --tile-ink: #151515;
    --tile-paper: #F5F0E6;
    --tile-gold: #F2B412;
    --tile-ink-border: #151515;
    --tile-paper-border: #151515;

    --display: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --text: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --radius: 10px;
    --gap: 12px;
    --pad: clamp(18px, 2.4vw, 28px);
    --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --page: #0E0E0E;
        --card: #1B1B1B;
        --outline: #2E2E2E;
        --divider: #2A2A2A;
        --ink: #F6F2EA;
        --muted: #A39E94;

        --strong-bg: #F2B412;
        --strong-fg: #151515;
        --strong-soft: #3B2C04;
        --strong-label: #151515;
        --strong-line: #C99408;
        --highlight-bg: #F6F2EA;
        --highlight-fg: #151515;
        --highlight-soft: #55504A;

        --button-bg: #F2B412;
        --button-fg: #151515;
        --focus: #F2B412;

        --tile-ink-border: #2E2E2E;
        --tile-paper-border: #F5F0E6;
    }
}

/* ------------------------------------------------------------------- base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--text);
    font-size: 1.0625rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

strong,
b {
    font-weight: 600;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: #F2B412;
    color: #151515;
}

.wrap {
    width: 100%;
    max-width: 1260px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.nowrap {
    white-space: nowrap;
}

/* `hidden` must win over the display of a tile or a grid. */
[hidden] {
    display: none !important;
}

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

.skip {
    position: absolute;
    left: 12px;
    top: -80px;
    z-index: 10;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--button-bg);
    color: var(--button-fg);
    font-weight: 600;
    text-decoration: none;
}

.skip:focus {
    top: 12px;
}

/* ------------------------------------------------------------------- type */

.display,
.h2,
.h3 {
    font-family: var(--display);
    font-weight: 700;
    text-wrap: balance;
}

.display {
    font-size: clamp(2.375rem, 1.35rem + 4.6vw, 4.5rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.h2 {
    font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.625rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.h3 {
    font-size: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.lead {
    font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem);
    line-height: 1.5;
    color: var(--muted);
    text-wrap: pretty;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* The one marked phrase in the headline: the word highlight of the audiobook transcript. */
.hl {
    background: #F2B412;
    color: #151515;
    border-radius: 8px;
    padding: 0 0.14em 0.04em;
    margin-inline: -0.06em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* ----------------------------------------------------------------- header */

.top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px clamp(10px, 2vw, 22px);
    padding-block: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    white-space: nowrap;
    margin-right: auto;
}

.brand__mark {
    width: 36px;
    height: 36px;
    flex: none;
}

.brand__mark rect {
    stroke: var(--tile-ink-border);
    stroke-width: 4;
}

.top__nav {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 22px);
}

.top__link {
    display: none;
    min-height: 44px;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
}

.top__link:hover {
    text-decoration: underline;
}

@media (min-width: 620px) {
    .top__link {
        display: inline-flex;
    }
}

/* With the book shop: four links. A row of their own under the name on a phone, beside it on a wide screen. */
.top__nav--shop {
    order: 3;
    flex: 1 1 100%;
}

.top__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 clamp(14px, 2.2vw, 26px);
}

.top__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    white-space: nowrap;
}

.top__links a:hover {
    text-decoration: underline;
}

@media (min-width: 860px) {
    .top__nav--shop {
        order: 0;
        flex: 0 1 auto;
    }

    .top__links a {
        font-size: 1rem;
    }
}

/* Two options in one outlined pill; the selected one is filled. */
.seg {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--outline);
    border-radius: 999px;
    background: var(--card);
}

.seg a,
.seg span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.seg [aria-current] {
    background: var(--button-bg);
    color: var(--button-fg);
}

.seg a:not([aria-current]):hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font: 600 1rem/1.25 var(--text);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn--primary {
    background: var(--button-bg);
    color: var(--button-fg);
}

.btn--outline {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
}

/* Not a link: the store that is not open yet. */
.btn--soon {
    background: transparent;
    border-color: var(--muted);
    color: var(--muted);
    cursor: default;
}

a.btn:hover,
button.btn:hover {
    text-decoration: underline;
    text-underline-offset: 0.22em;
}

@media (prefers-reduced-motion: no-preference) {
    a.btn,
    button.btn {
        transition: transform 120ms ease-out;
    }

    a.btn:active,
    button.btn:active {
        transform: scale(0.97);
    }
}

.stores {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 479px) {
    .stores .btn {
        width: 100%;
    }
}

.pro {
    display: inline-block;
    vertical-align: 0.12em;
    margin-left: 0.25em;
    padding: 2px 8px 1px;
    border-radius: 999px;
    background: var(--button-bg);
    color: var(--button-fg);
    font: 600 0.6875rem/1.45 var(--text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ------------------------------------------------------------------ cards */

.card {
    background: var(--card);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    padding: var(--pad);
}

.card--strong {
    background: var(--strong-bg);
    border-color: var(--strong-bg);
    color: var(--strong-fg);
    --muted: var(--strong-soft);
    --divider: var(--strong-line);
    --focus: var(--strong-label);
}

.card--strong .label {
    color: var(--strong-label);
}

.card--highlight {
    background: var(--highlight-bg);
    border-color: var(--highlight-bg);
    color: var(--highlight-fg);
    --ink: var(--highlight-fg);
    --muted: var(--highlight-soft);
    --button-bg: #151515;
    --button-fg: #FFFFFF;
    --focus: #151515;
}

/* ------------------------------------------------------------------- hero */

/*
 * The hero is a stage: one ink tile with the headline as real text and, beside it (under it on a
 * phone), a box that holds a still picture of the app. public/js/site-hero.js draws a live scene on
 * the canvas that covers the whole tile and then fades the still picture out. Nothing moves when
 * that happens: the canvas is laid over the tile and the box keeps its size.
 */
.tile.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    margin-top: clamp(0px, 1vw, 8px);
}

.hero__canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.hero--live .hero__canvas {
    opacity: 1;
}

.hero__text {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(14px, 2vw, 22px);
    padding: clamp(22px, 5vw, 32px) var(--pad) 8px;
}

.hero__text .lead {
    max-width: 32em;
}

.hero__cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}

.hero__version {
    max-width: 34em;
}

.hero__version b {
    color: var(--ink);
}

.hero__scene {
    position: relative;
    display: flex;
    min-height: clamp(380px, 104vw, 480px);
}

.hero__still {
    min-height: 0;
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
}

.hero--live .hero__still {
    opacity: 0;
    visibility: hidden;
}

@media (prefers-reduced-motion: no-preference) {
    .hero__canvas {
        transition: opacity 500ms ease-out;
    }

    .hero__still {
        transition: opacity 400ms ease-out, visibility 0s linear 400ms;
    }
}

@media (min-width: 900px) {
    .tile.hero {
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
        align-items: stretch;
        min-height: min(700px, 86vh);
    }

    .hero__text {
        justify-content: center;
        padding: clamp(28px, 4vw, 56px);
        padding-right: clamp(28px, 4vw, 56px);
    }

    .hero__scene {
        min-height: 560px;
    }

    .hero__still {
        align-self: stretch;
        padding-top: 40px;
    }
}

/* One outlined strip of plain facts, like the prayer-times strip of the app. */
.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: var(--gap);
    padding: 0;
    overflow: hidden;
}

.facts > div {
    padding: 16px var(--pad);
    border-top: 1px solid var(--divider);
    border-left: 1px solid var(--divider);
    margin: -1px 0 0 -1px;
}

.facts dt {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.0625rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.facts dd {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.4;
}

@media (min-width: 900px) {
    .facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .facts > div {
        padding-block: 20px;
    }
}

/* --------------------------------------------------------------- sections */

.section {
    padding-top: clamp(56px, 8vw, 104px);
}

.section__head {
    display: grid;
    gap: 12px;
    margin-bottom: clamp(22px, 3vw, 36px);
    max-width: 46rem;
}

.section__head .label {
    color: var(--muted);
}

/* ------------------------------------------------------------------ bento */

.bento {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.tile--ink {
    background: var(--tile-ink);
    border-color: var(--tile-ink-border);
    color: #FFFFFF;
    --ink: #FFFFFF;
    --muted: #C9C4BA;
    --button-bg: #F2B412;
    --button-fg: #151515;
    --focus: #F2B412;
}

.tile--ink .label {
    color: #F2B412;
}

.tile--paper {
    background: var(--tile-paper);
    border-color: var(--tile-paper-border);
    color: #151515;
    --ink: #151515;
    --muted: #6F6A62;
    --button-bg: #151515;
    --button-fg: #FFFFFF;
    --focus: #151515;
}

.tile--gold {
    background: var(--tile-gold);
    border-color: var(--tile-gold);
    color: #151515;
    --ink: #151515;
    --muted: #3B2C04;
    --button-bg: #151515;
    --button-fg: #FFFFFF;
    --focus: #151515;
}

.tile--card {
    background: var(--card);
    border-color: var(--outline);
}

.tile__text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--pad);
}

.tile__text > .label {
    margin-bottom: -2px;
}

.tile__text > p {
    color: var(--muted);
}

/* Feature lists: a small square, not an icon. */
.points {
    display: grid;
    gap: 10px;
    margin-top: 4px;
    font-size: 1rem;
    line-height: 1.5;
}

.points li {
    position: relative;
    padding-left: 18px;
}

.points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.58em;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: currentColor;
}

/*
 * A screenshot inside a tile. The picture is a phone on the tile's own colour, cut off on one side.
 * It always keeps its full width; the cut side stays glued to the edge of the tile, and when the box
 * is shorter than the picture the other side is what gets clipped. (Auto margins never go negative,
 * so the picture cannot be pushed past the edge it has to keep.)
 */
.shot {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: clamp(260px, 78vw, 400px);
    overflow: hidden;
    padding-inline: clamp(2px, 0.6vw, 8px);
}

.shot img {
    flex: none;
    width: 100%;
    height: auto;
    margin-top: auto;
}

/* The phone hangs from the top edge instead (its lower end is the visible one), so it goes above the text. */
.shot--hang {
    flex-direction: column-reverse;
    order: -1;
}

.shot--hang img {
    margin-top: 0;
    margin-bottom: auto;
}

.tile--narrow .shot img {
    max-width: 420px;
    margin-inline: auto;
}

@media (min-width: 700px) {
    .bento {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-auto-flow: dense;
    }

    .bento > .tile {
        grid-column: span 3;
    }

    .bento > .tile--wide,
    .bento > .tile--7,
    .bento > .tile--t6 {
        grid-column: span 6;
    }

    /* Text beside the phone. */
    .tile--split:not(.tile--split-lg) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
        align-items: stretch;
    }

    .tile--split:not(.tile--split-lg) .shot {
        min-height: 380px;
    }

    .tile--split:not(.tile--split-lg) .shot--hang {
        order: 0;
    }

    .shot {
        min-height: 320px;
    }
}

@media (min-width: 1060px) {
    .bento {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-auto-flow: row;
    }

    .bento > .tile {
        grid-column: span 4;
    }

    .bento > .tile--wide,
    .bento > .tile--8 {
        grid-column: span 8;
    }

    .bento > .tile--5 {
        grid-column: span 5;
    }

    .bento > .tile--7 {
        grid-column: span 7;
    }

    .bento > .tile--tall {
        grid-row: span 2;
    }

    .tile--split,
    .tile--split.tile--split-lg {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
        align-items: stretch;
    }

    .tile--split .shot,
    .tile--split.tile--split-lg .shot {
        min-height: 400px;
    }

    .tile--flip {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) !important;
    }

    .bento > .tile--even {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    }

    .tile--flip .tile__text {
        order: 2;
    }

    .tile--split .shot--hang {
        order: 0;
    }
}

/* A tile of words only: the label stays at the top, the rest sits at the bottom. */
.tile--note .tile__text {
    flex: 1 1 auto;
}

.tile--note .tile__text > .label {
    margin-bottom: auto;
    padding-bottom: 28px;
}

/* One outlined card, rows split by dividers. */
.rows {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    border-top: 1px solid var(--divider);
}

.rows li {
    display: grid;
    flex: 1 1 auto;
    align-content: center;
    gap: 2px;
    padding: 14px var(--pad);
    border-bottom: 1px solid var(--divider);
}

.rows li:last-child {
    border-bottom: 0;
}

.rows b {
    font-weight: 600;
}

.rows li > span {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.45;
}

.tile--card {
    container-type: inline-size;
}

@container (min-width: 420px) {
    .rows li {
        grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr);
        align-items: baseline;
        gap: 16px;
    }
}

@container (min-width: 640px) {
    .rows li {
        grid-template-columns: minmax(0, 13.5em) minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------------ books */

/* The set offer: what it is, the price, one button; beside it the covers and how its Pro arrives. */
.offer__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: var(--pad);
}

.offer__text > p {
    max-width: 34em;
    color: var(--muted);
}

.offer__price {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 4px 14px;
    margin-top: 4px;
    color: #F2B412 !important;
}

.offer__price strong {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(3rem, 2rem + 4.4vw, 4.5rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.offer__price > span {
    display: grid;
    padding-bottom: 0.3em;
    color: var(--ink);
    font-size: 0.9375rem;
    line-height: 1.35;
}

.offer__price > span > span:last-child {
    font-weight: 600;
}

.offer__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    width: 100%;
    margin-top: 4px;
}

.offer__cta .small {
    display: grid;
    color: var(--muted);
    line-height: 1.4;
}

.offer__side {
    display: grid;
    gap: 18px;
    align-content: end;
    padding: 0 var(--pad) var(--pad);
}

.offer__covers {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(8px, 2%, 18px);
}

.offer__cover {
    height: auto;
}

.offer__cover--main {
    width: 40%;
    max-width: 210px;
}

.offer__cover--left,
.offer__cover--right {
    width: 25%;
    max-width: 130px;
    border-radius: 6px;
}

.offer__pro {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid #3A3A3A;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.offer__pro p {
    color: var(--muted);
}

@media (max-width: 479px) {
    .offer__cta .btn {
        width: 100%;
    }
}

@media (min-width: 700px) {
    .bento > .offer {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    .tile.offer {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .offer__text {
        justify-content: center;
        padding: clamp(24px, 3vw, 40px);
    }

    .offer__side {
        padding: clamp(24px, 3vw, 40px);
        padding-left: 8px;
    }
}

.book {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: stretch;
}

/* The cover stands on a paper ground, in both themes, like a screenshot tile. */
.book__cover {
    display: grid;
    place-items: center;
    padding: 16px 12px;
    background: var(--tile-paper);
    border-right: 1px solid var(--outline);
}

.book__cover img {
    width: 100%;
    max-width: 170px;
    height: auto;
    border: 1px solid #151515;
    border-radius: 4px;
}

/* The hardcover is a cut-out with its own edge. */
.book--main .book__cover img {
    max-width: 230px;
    border: 0;
    border-radius: 0;
}

.book__price b {
    color: var(--ink);
    font-weight: 600;
}

.books__buy {
    gap: 4px;
}

.books__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 var(--pad) var(--pad);
}

@media (max-width: 479px) {
    .books__actions .btn {
        width: 100%;
    }
}

@media (min-width: 700px) {
    .bento > .book--main,
    .bento > .books__buy {
        grid-column: span 6;
    }

    .book {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .book__cover {
        padding: 24px;
        border-right: 0;
        border-bottom: 1px solid var(--outline);
    }

    .book--main {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
        grid-template-rows: auto;
    }

    .book--main .book__cover {
        border-bottom: 0;
        border-right: 1px solid var(--outline);
    }

    .book--main .tile__text {
        justify-content: center;
    }

    .books__buy {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .books__buy .tile__text {
        flex: 1 1 auto;
    }

    .books__actions {
        flex: none;
        padding: var(--pad);
    }
}

@media (min-width: 1060px) {
    .bento > .book {
        grid-column: span 3;
    }

    .bento > .book--main {
        grid-column: span 6;
    }

    .bento > .books__buy {
        grid-column: span 12;
    }
}

/* ------------------------------------------------------------ free and pro */

.plans {
    display: grid;
    gap: var(--gap);
}

.plan {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.plan .points {
    margin-top: 6px;
}

.plan__note {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--divider);
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

@media (min-width: 800px) {
    .plans {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ------------------------------------------------------------------ close */

.close {
    display: grid;
    gap: 22px;
    align-items: center;
    padding: clamp(24px, 4.5vw, 56px);
}

.close p {
    margin-top: 10px;
    max-width: 30em;
}

@media (min-width: 900px) {
    .close {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 40px;
    }

    .close .stores {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ----------------------------------------------------------------- footer */

.foot {
    display: grid;
    gap: 24px;
    margin-top: clamp(56px, 8vw, 104px);
    padding-block: 28px 40px;
    border-top: 1px solid var(--outline);
    font-size: 0.9375rem;
}

.foot__links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
}

.foot__links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 600;
    text-decoration: none;
}

.foot__links a:hover {
    text-decoration: underline;
}

.foot__meta {
    display: grid;
    gap: 4px;
    color: var(--muted);
}

.foot__meta a {
    color: var(--ink);
}

@media (min-width: 900px) {
    .foot {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .foot__meta {
        text-align: right;
    }
}

/* ------------------------------------------------- documents (legal, help) */

.doc__head {
    display: grid;
    gap: 14px;
    padding-block: clamp(20px, 5vw, 56px) clamp(24px, 4vw, 44px);
    max-width: 52rem;
}

.doc__head .label {
    color: var(--muted);
}

.doc__head .display {
    font-size: clamp(2.125rem, 1.5rem + 3vw, 3.5rem);
}

.doc__grid {
    display: grid;
    gap: clamp(20px, 3vw, 48px);
    align-items: start;
}

.toc {
    padding: 0;
    overflow: hidden;
}

.toc__title {
    padding: 14px 18px 12px;
    color: var(--muted);
}

.toc ol {
    counter-reset: toc;
    border-top: 1px solid var(--divider);
}

.toc li {
    counter-increment: toc;
    border-bottom: 1px solid var(--divider);
}

.toc li:last-child {
    border-bottom: 0;
}

.toc a {
    display: grid;
    grid-template-columns: 1.9em minmax(0, 1fr);
    align-items: baseline;
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.9375rem;
    line-height: 1.35;
    text-decoration: none;
}

.toc a::before {
    content: counter(toc);
    color: var(--muted);
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.8125rem;
}

.toc a:hover {
    text-decoration: underline;
}

.toc a:focus-visible {
    outline-offset: -3px;
}

@media (min-width: 1000px) {
    .doc__grid {
        grid-template-columns: 290px minmax(0, 1fr);
    }

    .toc {
        position: sticky;
        top: 20px;
        max-height: calc(100vh - 40px);
        overflow: auto;
    }
}

.prose {
    max-width: 44rem;
    counter-reset: section;
}

.prose > * + * {
    margin-top: 1em;
}

.prose section {
    margin-top: clamp(36px, 5vw, 52px);
    counter-increment: section;
}

.prose section > * + * {
    margin-top: 0.9em;
}

.prose h2 {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 12px;
    align-items: baseline;
    padding-top: 18px;
    border-top: 1px solid var(--outline);
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.3125rem, 1.2rem + 0.6vw, 1.625rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.prose section > h2::before {
    content: counter(section);
    color: var(--muted);
    font-size: 0.8em;
}

.prose h3 {
    margin-top: 1.6em;
    font-family: var(--text);
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.4;
}

.prose ul,
.prose ol {
    display: grid;
    gap: 0.5em;
}

.prose ul > li {
    position: relative;
    padding-left: 20px;
}

.prose ul > li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: currentColor;
}

.prose ol {
    counter-reset: step;
}

.prose ol > li {
    position: relative;
    padding-left: 44px;
    min-height: 32px;
    padding-top: 2px;
    counter-increment: step;
}

.prose ol > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--outline);
    border-radius: 50%;
    background: var(--card);
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.8125rem;
}

.prose a {
    font-weight: 600;
}

.prose .card {
    display: grid;
    gap: 12px;
}

.prose .card .label {
    color: var(--muted);
}

.prose .card--strong .label {
    color: var(--strong-label);
}

.prose .card--highlight .label {
    color: var(--highlight-fg);
}

/* What is kept where: term on the left, explanation on the right; stacked on a phone. */
.ledger {
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: var(--card);
    overflow: hidden;
}

.ledger > div {
    display: grid;
    gap: 4px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--divider);
}

.ledger > div:last-child {
    border-bottom: 0;
}

.ledger dt {
    font-weight: 600;
}

.ledger dd {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.5;
}

@media (min-width: 640px) {
    .ledger > div {
        grid-template-columns: minmax(0, 12.5em) minmax(0, 1fr);
        gap: 18px;
    }
}

.contact-line {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.25rem, 1.1rem + 1vw, 1.75rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- support */

.help {
    display: grid;
    gap: var(--gap);
    align-items: start;
}

.help__side {
    display: grid;
    gap: var(--gap);
}

.help .card {
    display: grid;
    gap: 12px;
}

.help .card .label {
    color: var(--muted);
}

.help .card--strong .label {
    color: var(--strong-label);
}

.help .card--strong p {
    color: var(--strong-soft);
}

.help .card--strong a {
    color: var(--strong-fg);
}

.faq {
    padding: 0;
    gap: 0 !important;
    overflow: hidden;
}

.faq__head {
    display: grid;
    gap: 10px;
    padding: var(--pad);
}

.faq__item {
    display: grid;
    gap: 6px;
    padding: 18px var(--pad);
    border-top: 1px solid var(--divider);
}

.faq__item h3 {
    font-family: var(--text);
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.4;
}

.faq__item p {
    color: var(--muted);
}

.linklist {
    display: grid;
    margin: 0 calc(var(--pad) * -1) calc(var(--pad) * -1);
    border-top: 1px solid var(--divider);
}

.linklist a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 12px var(--pad);
    border-bottom: 1px solid var(--divider);
    font-weight: 600;
    text-decoration: none;
}

.linklist li:last-child a {
    border-bottom: 0;
}

.linklist a::after {
    content: "\2192";
    color: var(--muted);
}

.linklist a:hover {
    text-decoration: underline;
}

.linklist a:focus-visible {
    outline-offset: -3px;
}

@media (min-width: 900px) {
    .help {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    }
}

/* ------------------------------------------------- group invitation page */

.invite {
    display: grid;
    gap: var(--gap);
    max-width: 560px;
    margin-inline: auto;
    padding-top: clamp(8px, 3vw, 32px);
}

.invite__card {
    display: grid;
    gap: 14px;
    padding: clamp(22px, 5vw, 32px);
    text-align: center;
}

.invite__card .label {
    color: var(--muted);
}

.invite__card h1 {
    font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.invite__card .lead {
    font-size: 1.0625rem;
}

.code {
    display: grid;
    gap: 2px;
    margin-top: 6px;
    padding: 18px 12px 16px;
    border-radius: var(--radius);
    background: var(--highlight-bg);
    color: var(--highlight-fg);
}

.code .label {
    color: var(--highlight-fg);
}

.code .value {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.75rem, 8.6vw, 2.5rem);
    line-height: 1.2;
    letter-spacing: 0.08em;
    word-break: break-all;
    -webkit-user-select: all;
    user-select: all;
}

.copy {
    justify-self: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: 600 0.9375rem/1.2 var(--text);
    cursor: pointer;
}

.copy:hover {
    text-decoration: underline;
}

.invite__actions {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.invite__actions .btn {
    width: 100%;
}

.hint {
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.steps-card {
    display: grid;
    gap: 16px;
}

.steps-card h2 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.steps {
    display: grid;
    gap: 14px;
    counter-reset: step;
}

.steps li {
    position: relative;
    min-height: 30px;
    padding: 2px 0 0 44px;
    color: var(--muted);
    counter-increment: step;
}

.steps li strong {
    color: var(--ink);
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--outline);
    border-radius: 50%;
    color: var(--ink);
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.8125rem;
}

.invite__foot {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding-bottom: 32px;
    color: var(--muted);
    font-size: 0.9375rem;
    text-align: center;
}

.invite__foot a {
    color: var(--ink);
    font-weight: 600;
}

/* ------------------------------------------------------------------ print */

@media print {
    .top__nav,
    .skip,
    .toc,
    .stores {
        display: none !important;
    }

    body {
        background: #FFFFFF;
        color: #000000;
    }
}
