/*
 * The landing page's whole stylesheet (#1102).
 *
 * Hand written and self-hosted, and not Bootstrap. The storefront ships 11MB of
 * vendored framework because it renders a catalogue, a basket and a checkout;
 * this site renders six pages and one form. Vendoring a framework for that
 * would be eleven megabytes of public attack surface and licence obligation in
 * exchange for a grid.
 *
 * Every rule here is served from this origin, so the Content-Security-Policy's
 * style-src 'self' holds with no 'unsafe-inline' and no remote stylesheet - and
 * because there is no style attribute anywhere in the templates, nothing on
 * this site needs the policy relaxed to render.
 */

:root {
    --cbm-bg: #ffffff;
    --cbm-bg-muted: #f5f7fa;
    --cbm-fg: #14202e;
    --cbm-fg-muted: #4a5a6e;
    --cbm-border: #d8e0ea;
    --cbm-accent: #0d5bd1;
    --cbm-accent-fg: #ffffff;
    --cbm-accent-quiet: #e8f0fd;
    --cbm-success-bg: #e7f6ec;
    --cbm-success-border: #58a86f;
    --cbm-warning-bg: #fdf3e2;
    --cbm-warning-border: #c9860f;
    --cbm-error-bg: #fdeceb;
    --cbm-error-border: #c0392b;
    --cbm-radius: 10px;
    --cbm-shell: 68rem;
}

/*
 * Dark mode follows the reader's own setting and nothing else. There is no
 * toggle, because a toggle needs somewhere to remember the choice and the only
 * state this site keeps about a visitor is the language they read in.
 */
@media (prefers-color-scheme: dark) {
    :root {
        --cbm-bg: #10161f;
        --cbm-bg-muted: #161e2a;
        --cbm-fg: #e8edf4;
        --cbm-fg-muted: #a6b4c6;
        --cbm-border: #27323f;
        --cbm-accent: #6aa3ff;
        --cbm-accent-fg: #0b1220;
        --cbm-accent-quiet: #17263c;
        --cbm-success-bg: #16281c;
        --cbm-success-border: #3f8256;
        --cbm-warning-bg: #2b2213;
        --cbm-warning-border: #b07d1c;
        --cbm-error-bg: #2c1817;
        --cbm-error-border: #b4463a;
    }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--cbm-bg);
    color: var(--cbm-fg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

a { color: var(--cbm-accent); }
a:hover, a:focus { text-decoration: none; }

:focus-visible {
    outline: 3px solid var(--cbm-accent);
    outline-offset: 2px;
}

.cbm-shell {
    width: 100%;
    max-width: var(--cbm-shell);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.cbm-narrow { max-width: 44rem; }

/* The skip link: off-screen until it is focused, which is the one moment it
   is useful. */
.cbm-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--cbm-accent);
    color: var(--cbm-accent-fg);
    padding: 0.5rem 1rem;
}
.cbm-skip:focus { left: 0; z-index: 10; }

/* The honeypot's home. Moved off-screen rather than display:none, which some
   scripts skip - see the challenge component. */
.cbm-offscreen {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

.cbm-header {
    border-bottom: 1px solid var(--cbm-border);
    background: var(--cbm-bg);
}

.cbm-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.cbm-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 650;
    color: var(--cbm-fg);
    text-decoration: none;
}

.cbm-brand-mark {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    background: var(--cbm-accent);
    color: var(--cbm-accent-fg);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.cbm-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
}

.cbm-nav a {
    text-decoration: none;
    color: var(--cbm-fg-muted);
}

.cbm-nav a:hover, .cbm-nav a:focus { color: var(--cbm-fg); }

.cbm-nav-cta {
    padding: 0.35rem 0.85rem;
    border-radius: var(--cbm-radius);
    background: var(--cbm-accent);
    color: var(--cbm-accent-fg) !important;
}

.cbm-languages { display: flex; gap: 0.4rem; }

.cbm-language {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border: 1px solid var(--cbm-border);
    border-radius: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--cbm-fg-muted);
}

.cbm-language-current {
    background: var(--cbm-accent-quiet);
    color: var(--cbm-fg);
}

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

.cbm-main { display: block; }

.cbm-hero {
    padding: 4rem 0 3rem;
    background: var(--cbm-accent-quiet);
    border-bottom: 1px solid var(--cbm-border);
}

.cbm-eyebrow {
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.78rem;
    color: var(--cbm-fg-muted);
}

.cbm-hero-title { font-size: 2.5rem; max-width: 24ch; }
.cbm-hero-lead { font-size: 1.15rem; max-width: 58ch; color: var(--cbm-fg-muted); }
.cbm-hero-note { font-size: 0.9rem; color: var(--cbm-fg-muted); margin-bottom: 0; }

.cbm-section { padding: 3rem 0; }
.cbm-section-muted { background: var(--cbm-bg-muted); }
.cbm-section-lead { color: var(--cbm-fg-muted); max-width: 62ch; }

.cbm-cards {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.cbm-card {
    border: 1px solid var(--cbm-border);
    border-radius: var(--cbm-radius);
    padding: 1.25rem;
    background: var(--cbm-bg);
}

.cbm-card p { margin-bottom: 0; color: var(--cbm-fg-muted); }

/*
 * A list inside a card. The shared .cbm-list is written for body copy at full
 * measure, so inside a card it needs its own width and a little air between
 * items - these are four-line sentences, not one-word bullets.
 */
.cbm-card-list { margin: 0; max-width: none; font-size: 0.92rem; color: var(--cbm-fg-muted); }
.cbm-card-list li { margin-bottom: 0.6rem; }
.cbm-card-list li:last-child { margin-bottom: 0; }

.cbm-list { padding-left: 1.2rem; max-width: 62ch; }
.cbm-list li { margin-bottom: 0.5rem; }

.cbm-closing { max-width: 48rem; }

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

.cbm-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }

.cbm-button {
    display: inline-block;
    padding: 0.6rem 1.15rem;
    border: 1px solid var(--cbm-border);
    border-radius: var(--cbm-radius);
    background: var(--cbm-bg);
    color: var(--cbm-fg);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.cbm-button-primary {
    background: var(--cbm-accent);
    border-color: var(--cbm-accent);
    color: var(--cbm-accent-fg);
}

/* --- notices -------------------------------------------------------------- */

.cbm-notice {
    border: 1px solid var(--cbm-border);
    border-left-width: 4px;
    border-radius: var(--cbm-radius);
    padding: 1rem 1.15rem;
    margin: 0 0 1.25rem;
    background: var(--cbm-bg-muted);
}

.cbm-notice h2 { font-size: 1.15rem; }
.cbm-notice p:last-child, .cbm-notice ul:last-child { margin-bottom: 0; }
.cbm-notice ul { margin: 0; padding-left: 1.2rem; }

.cbm-notice-success { background: var(--cbm-success-bg); border-left-color: var(--cbm-success-border); }
.cbm-notice-warning { background: var(--cbm-warning-bg); border-left-color: var(--cbm-warning-border); }
.cbm-notice-error { background: var(--cbm-error-bg); border-left-color: var(--cbm-error-border); }

/* --- forms ---------------------------------------------------------------- */

.cbm-form { max-width: 34rem; }

.cbm-field { margin-bottom: 1.15rem; }

.cbm-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.cbm-field input,
.cbm-field select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--cbm-border);
    border-radius: var(--cbm-radius);
    background: var(--cbm-bg);
    color: var(--cbm-fg);
    font: inherit;
}

/*
 * The country select. `color-scheme` is what makes the native dropdown's own
 * list follow the reader's theme - without it a dark page opens a white list,
 * which is the one part of a select a stylesheet cannot reach.
 */
.cbm-field select { color-scheme: light dark; }

.cbm-field input[size] { width: auto; min-width: 6rem; }

.cbm-hint {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: var(--cbm-fg-muted);
}

.cbm-consent {
    font-size: 0.9rem;
    color: var(--cbm-fg-muted);
    border-top: 1px solid var(--cbm-border);
    padding-top: 1rem;
}

/* --- pricing -------------------------------------------------------------- */

.cbm-plans {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    margin-top: 2rem;
}

.cbm-plan {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cbm-border);
    border-radius: var(--cbm-radius);
    padding: 1.5rem;
    background: var(--cbm-bg);
}

.cbm-plan-name { font-size: 1.3rem; margin-bottom: 0.25rem; }
.cbm-plan-description { color: var(--cbm-fg-muted); }

.cbm-plans-heading { margin-top: 2.5rem; }
.cbm-plans-heading:first-of-type { margin-top: 2rem; }

.cbm-plan-prices { list-style: none; margin: 0 0 1rem; padding: 0; }

/*
 * One block per way of paying, stacked: the figure and its basis on one line,
 * the comparison under it. The two are separate elements rather than one
 * sentence so the amount can carry its own size without the note growing with
 * it - and so the annual block can be tinted as the cheaper option without
 * that colour landing on a price.
 */
.cbm-plan-price {
    padding: 0.6rem 0;
    border-top: 1px solid var(--cbm-border);
}
.cbm-plan-prices li:first-child { border-top: 0; padding-top: 0; }

.cbm-plan-price-headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem; }
.cbm-plan-amount { font-size: 1.6rem; font-weight: 650; }
.cbm-plan-interval { color: var(--cbm-fg-muted); font-size: 0.9rem; }

.cbm-plan-price-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.85rem;
    color: var(--cbm-fg-muted);
}

/*
 * The saving is the one thing on this page a visitor is asked to compare, so
 * it is the one thing that is not muted. Accent on a quiet ground rather than
 * a green "success" tint: nothing has succeeded, it is a price difference.
 */
.cbm-plan-saving {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--cbm-radius);
    background: var(--cbm-accent-quiet);
    color: var(--cbm-accent);
    font-size: 0.85rem;
    font-weight: 600;
}

/*
 * Add-ons read as secondary to the plans above them: the same card, on the
 * muted ground, with a smaller price. They are bought on top of a plan, and a
 * card indistinguishable from a plan's is what the grid used to imply.
 */
.cbm-addons { margin-bottom: 1rem; }
.cbm-addon { background: var(--cbm-bg-muted); }
.cbm-addon .cbm-plan-amount { font-size: 1.3rem; }

.cbm-plan-limits { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.cbm-plan-limits li {
    padding: 0.35rem 0;
    border-top: 1px solid var(--cbm-border);
}
.cbm-plan-limit-key { color: var(--cbm-fg-muted); }
.cbm-plan-limit-headline { display: block; font-weight: 600; }
.cbm-plan-limit-behaviour { display: block; font-size: 0.82rem; color: var(--cbm-fg-muted); }

/*
 * The overage bands. A row per band, the span on the left and the rate on the
 * right, so the rates line up and a reader can see the price fall as the bands
 * rise - which is the thing a graduated table is trying to communicate and the
 * thing a wrapped sentence hides.
 */
.cbm-plan-rates {
    list-style: none;
    margin: 0.35rem 0;
    padding: 0 0 0 0.75rem;
    border-left: 2px solid var(--cbm-border);
    font-size: 0.85rem;
}

.cbm-plan-rates li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.15rem 0;
    border: 0;
}

.cbm-rate-span { color: var(--cbm-fg-muted); }
.cbm-rate-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

.cbm-plan .cbm-actions { margin-top: auto; padding-top: 1.25rem; }

.cbm-fineprint { font-size: 0.85rem; color: var(--cbm-fg-muted); margin-top: 1.5rem; }

/* --- summaries and prose -------------------------------------------------- */

.cbm-summary { margin: 0 0 1.5rem; }
.cbm-summary dt { font-weight: 600; margin-top: 0.85rem; }
.cbm-summary dd { margin: 0.15rem 0 0; color: var(--cbm-fg-muted); }

.cbm-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

.cbm-reference {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--cbm-border);
    border-radius: var(--cbm-radius);
    background: var(--cbm-bg-muted);
}

.cbm-prose section { margin-bottom: 2rem; }
.cbm-prose h2 { margin-top: 0; font-size: 1.25rem; }

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

.cbm-footer {
    border-top: 1px solid var(--cbm-border);
    background: var(--cbm-bg-muted);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.cbm-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.cbm-footer-line { margin: 0; color: var(--cbm-fg-muted); font-size: 0.9rem; }

.cbm-footer-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.9rem; }

@media (max-width: 40rem) {
    .cbm-hero { padding: 2.5rem 0 2rem; }
    .cbm-hero-title { font-size: 1.9rem; }
    .cbm-header-inner { gap: 0.75rem; }
    .cbm-nav { gap: 0.9rem; }
}
