/* Kirby's site, in Kirby's own colours.
 *
 * Every value here is lifted from Sources/Design/KirbyTheme.swift, both themes.
 * A marketing site in different colours from the app is a small lie you notice
 * the moment you download it.
 *
 * Light is the default and dark arrives through prefers-color-scheme, so the
 * page follows whatever the reader's Mac is already set to. There's no toggle
 * on purpose: the app has themes, the site should just agree with the system.
 *
 * Two of the app's own light values are deliberately NOT used here. Its
 * tertiary grey (#868da1) lands at 3:1 on this ground, which is fine behind a
 * 10px sidebar label and not fine for the small print on a web page — so the
 * value below is darkened until it clears 4.5:1. */

:root {
    --canvas: #f7f7fa;
    --sidebar: #eff0f5;
    --surface: #ffffff;
    --raised: #e9ebf2;
    --border: #dcdee8;
    --text: #16181f;
    --text-2: #565d70;   /* 6.0:1 */
    --text-3: #656c7e;   /* 4.8:1 — the app's own is 3:1, too light to read */
    /* Light needs one blue where dark needs three: on a near-white ground the
     * brand blue is 6.0:1 as text and 6.4:1 behind white button text, so the
     * same value does every job. */
    --accent: #3b50d4;
    --accent-link: #3b50d4;
    --accent-button: #3b50d4;
    --people: #0f7a55;
    --notifications: #3b50d4;
    --newsletters: #7a45b8;
    --promotions: #9a6410;
    --pink: #b03256;
    --teal: #0e6e73;

    --width: 900px;
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --canvas: #14161c;
        --sidebar: #0e1015;
        --surface: #1a1d25;
        --raised: #232733;
        --border: #2a2e3a;
        --text: #e9ebf1;
        --text-2: #9098a8;
        --text-3: #7a8194;   /* 4.7:1 — the small print is still body text */
        /* Three shades of the same blue, because on this ground one can't do
         * all three jobs. The brand blue is right for a dot or a border; as
         * link text it lands at 4.4:1, just under the AA bar, and behind white
         * button text it's 4.1:1. Rather than lower the bar, links get a
         * lighter one and the filled button a darker one. */
        --accent: #5b72f2;        /* dots, borders, brand */
        --accent-link: #6b80f4;   /* 5.2:1 on canvas, 4.8:1 on a card */
        --accent-button: #4a5fe0; /* 5.2:1 behind white text */
        --people: #3fbf8f;
        --notifications: #5b72f2;
        --newsletters: #b07cf0;
        --promotions: #e0a030;
        --pink: #e87a9a;
        --teal: #4fc3c8;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}

a { color: var(--accent-link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
.download:focus-visible {
    outline: 2px solid var(--accent-link);
    outline-offset: 3px;
    border-radius: 4px;
}

.wrap { max-width: var(--width); margin: 0 auto; padding: 0 24px; }

/* --- Header ------------------------------------------------------------- */

header {
    padding: 96px 0 72px;
    text-align: center;
}

header img.icon {
    width: 128px;
    height: 128px;
    image-rendering: -webkit-optimize-contrast;
}

h1 {
    font-size: 46px;
    line-height: 1.1;
    margin: 24px 0 12px;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 20px;
    color: var(--text-2);
    margin: 0 auto 32px;
    max-width: 34ch;
}

.download {
    display: inline-block;
    background: var(--accent-button);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 28px;
    border-radius: var(--radius);
    border: none;
}

.download:hover { text-decoration: none; filter: brightness(1.08); }

.requirements {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-3);
}

/* --- Sections ----------------------------------------------------------- */

section { padding: 56px 0; border-top: 1px solid var(--border); }

h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-2);
    margin: 0 0 28px;
    font-weight: 600;
}

h3 { font-size: 18px; margin: 0 0 6px; }

p { margin: 0 0 16px; color: var(--text-2); }

p.lead { color: var(--text); font-size: 17px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

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

.card p:last-child { margin-bottom: 0; }

/* Dots carry their colour by class rather than inline, so each one can be a
 * different value in each theme. Inline hex was fine while the page was
 * dark-only; on a near-white ground the dark theme's greens and ambers go
 * pale and the dot stops reading as a dot. */
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: 1px;
    background: var(--accent);
}

.dot.people { background: var(--people); }
.dot.notifications { background: var(--notifications); }
.dot.newsletters { background: var(--newsletters); }
.dot.promotions { background: var(--promotions); }
.dot.pink { background: var(--pink); }
.dot.teal { background: var(--teal); }

/* --- Pricing ------------------------------------------------------------ */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.plan {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

/* Derived from the accent rather than a pinned rgba, so the paid plan stays
 * outlined in whichever blue the current theme is using. */
.plan.paid { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.plan h3 { color: var(--text); }

.plan .price { font-size: 26px; font-weight: 600; margin: 4px 0 14px; }

.plan ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }
.plan li { margin-bottom: 6px; }

/* --- Footer ------------------------------------------------------------- */

footer {
    padding: 48px 0 72px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 14px;
}

footer nav a { margin-right: 18px; }

/* --- Policy pages ------------------------------------------------------- */

.policy { padding: 72px 0; }
.policy h1 { font-size: 32px; text-align: left; }
.policy h2 {
    font-size: 17px;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    margin: 36px 0 10px;
}
.policy p { max-width: 68ch; }
.policy .updated { color: var(--text-3); font-size: 14px; }

@media (max-width: 600px) {
    header { padding: 64px 0 48px; }
    h1 { font-size: 34px; }
    .tagline { font-size: 18px; }
}
