/*
 * Kibble, web design system.
 *
 * Tokens are lifted from the app's Color.kt and Type.kt rather than re-picked, so the
 * landing page and the product are recognisably the same thing. If a value changes in one
 * place it has to change in the other; that is the cost of having two renderers.
 */

/* ------------------------------------------------------------------ tokens */

:root {
    /* LightColors, Color.kt */
    --ground: #F4EEE6;
    --surface: #FFFCF8;
    --surface-alt: #EDE4D8;
    --border: #E2D6C6;
    --divider: #EDE4D8;
    --accent: #E8913A;
    --accent-ink: #8E4C10;
    --accent-wash: #FBEAD4;
    --ink: #2B1F17;
    --ink-muted: #6E5A49;
    --ink-faint: #9C8975;
    --on-accent: #2B1A0B;
    --ok: #2F6F55;
    --ok-wash: #DCEBE2;
    --ok-ink: #1F4F3C;

    /* The wake sequence ignores the device theme, and so does the section that shows it. */
    --ring-ground: #0E0B0A;
    --ring-card: #1C1614;
    --ring-track: #2A211B;
    --ring-ink: #FFF6EA;
    --ring-ink-muted: #C7B5A5;
    --ring-ink-faint: #8E7B6B;
    --ring-accent: #F2AC63;

    --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --body: "Nunito Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Shape.kt */
    --r-card: 20px;
    --r-panel: 18px;
    --r-button: 18px;
    --r-small: 16px;

    --measure: 1120px;
    --gutter: clamp(20px, 5vw, 40px);
}

/*
 * Dark mode, in the two ways it can be asked for.
 *
 * The app's theme setting is System / Light / Dark, and the web should answer the same
 * three. The media query covers "follow the system"; the data-theme attribute covers an
 * explicit choice, and is guarded so that choosing Light on a dark OS actually gets light.
 * Tokens are duplicated because CSS has no way to share a block between the two.
 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* DarkColors, Color.kt */
        --ground: #191310;
        --surface: #241C17;
        --surface-alt: #302620;
        --border: #3B2F27;
        --divider: #3B2F27;
        --accent: #F2AC63;
        --accent-ink: #F2AC63;
        --accent-wash: #3A2A18;
        --ink: #F6EFE7;
        --ink-muted: #C7B5A5;
        --ink-faint: #99856F;
        --on-accent: #2B1A0B;
        --ok: #63C196;
        --ok-wash: #1A3128;
        --ok-ink: #9BD9BB;
    }
}

:root[data-theme="dark"] {
    /* DarkColors, Color.kt */
    --ground: #191310;
    --surface: #241C17;
    --surface-alt: #302620;
    --border: #3B2F27;
    --divider: #3B2F27;
    --accent: #F2AC63;
    --accent-ink: #F2AC63;
    --accent-wash: #3A2A18;
    --ink: #F6EFE7;
    --ink-muted: #C7B5A5;
    --ink-faint: #99856F;
    --on-accent: #2B1A0B;
    --ok: #63C196;
    --ok-wash: #1A3128;
    --ok-ink: #9BD9BB;
}

/* ------------------------------------------------------------------- base */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.12;
    margin: 0;
    text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

.wrap {
    width: 100%;
    max-width: var(--measure);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

section { padding-block: clamp(64px, 9vw, 120px); }

/* A word plus a colour, never colour alone, same rule as the app's StatusChip. */
.eyebrow {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin: 0 0 14px;
}

.lede { font-size: clamp(17px, 2vw, 20px); color: var(--ink-muted); max-width: 60ch; }

.section-head { max-width: 64ch; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head h2 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 14px; }

/* ----------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--ground) 88%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-weight: 800;
    font-size: 21px;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
}

.wordmark img { width: 32px; height: 32px; object-fit: contain; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 26px;
    border: none;
    border-radius: var(--r-button);
    font-family: var(--display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: transform 140ms ease, filter 140ms ease;
}

.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: var(--on-accent); }

.btn-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--border);
}

.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* ------------------------------------------------------------------- hero */

.hero { padding-top: clamp(40px, 6vw, 76px); padding-bottom: clamp(48px, 7vw, 96px); }

.hero .wrap {
    display: grid;
    gap: clamp(32px, 5vw, 64px);
    grid-template-columns: 1fr;
    align-items: center;
}

@media (min-width: 900px) {
    .hero .wrap { grid-template-columns: 1.05fr 0.95fr; }
}

.hero h1 {
    font-size: clamp(38px, 6.2vw, 68px);
    letter-spacing: -0.035em;
    margin-bottom: 20px;
}

.hero .lede { font-size: clamp(18px, 2.1vw, 21px); }

.hero-art {
    position: relative;
    display: grid;
    place-items: center;
}

.hero-art::before {
    /* A warm pool of light behind the cat, so a transparent cutout has something to sit on. */
    content: "";
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-wash) 0%, transparent 70%);
}

.hero-art img { position: relative; width: min(420px, 100%); }

/* ----------------------------------------------------------------- signup */

.signup { margin-top: 28px; max-width: 480px; }

.signup-row { display: flex; flex-wrap: wrap; gap: 10px; }

.signup input[type="email"] {
    flex: 1 1 240px;
    min-height: 52px;
    padding: 0 16px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r-button);
    font-family: var(--body);
    font-size: 16px;
    color: var(--ink);
}

.signup input[type="email"]::placeholder { color: var(--ink-faint); }

.signup-note { margin-top: 12px; font-size: 14px; color: var(--ink-faint); }

.signup-status {
    margin-top: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ok-ink);
    min-height: 1.4em;
}

/* Danger, from Color.kt. Tokenised so it resolves in every theme state, not just one. */
:root { --danger: #A8392E; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --danger: #E88C7F; }
}
:root[data-theme="dark"] { --danger: #E88C7F; }

.signup-status[data-state="error"] { color: var(--danger); }

/* ------------------------------------------------------------------ cards */

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 26px;
}

.card h3 { font-size: 20px; margin-bottom: 8px; }
.card p { color: var(--ink-muted); font-size: 15.5px; }

.card-num {
    font-family: var(--display);
    font-weight: 800;
    font-size: 15px;
    color: var(--accent-ink);
    margin-bottom: 10px;
    display: block;
}

.chip {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-wash);
    color: var(--accent-ink);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* The three-step loop, each panel led by the cat state it produces. */
.step img {
    width: 150px;
    margin: 0 auto 18px;
}

/* ------------------------------------------------------ the dark ring band */

.band-dark {
    background: var(--ring-ground);
    color: var(--ring-ink);
}

.band-dark h2 { color: var(--ring-ink); }
.band-dark .lede, .band-dark p { color: var(--ring-ink-muted); }
.band-dark .eyebrow { color: var(--ring-accent); }

.band-dark .card {
    background: var(--ring-card);
    border-color: var(--ring-track);
}

.band-dark .card h3 { color: var(--ring-ink); }
.band-dark .card p { color: var(--ring-ink-muted); }

.reliability-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.reliability-list li {
    display: flex;
    gap: 13px;
    align-items: flex-start;
    font-size: 16px;
    color: var(--ring-ink-muted);
}

.reliability-list strong { color: var(--ring-ink); font-weight: 700; }

.tick {
    flex: none;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 50%;
    background: var(--ring-track);
    color: var(--ring-accent);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
}

.disclaimer {
    margin-top: 32px;
    padding: 18px 20px;
    border-radius: var(--r-small);
    background: var(--ring-card);
    border: 1px solid var(--ring-track);
    font-size: 15px;
    color: var(--ring-ink-muted);
}

/* ---------------------------------------------------------------- pricing */

.plan {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 28px;
    display: flex;
    flex-direction: column;
}

.plan.featured { border: 2px solid var(--accent); }

.plan h3 { font-size: 23px; margin-bottom: 6px; }

.plan-price {
    font-family: var(--display);
    font-weight: 800;
    font-size: 32px;
    letter-spacing: -0.03em;
    margin: 12px 0 4px;
}

.plan-price small {
    font-family: var(--body);
    font-weight: 400;
    font-size: 15px;
    color: var(--ink-faint);
    letter-spacing: 0;
}

.plan ul { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 11px; }

.plan li {
    display: flex;
    gap: 11px;
    font-size: 15.5px;
    color: var(--ink-muted);
}

.plan li::before {
    content: "·";
    color: var(--accent);
    font-weight: 800;
    flex: none;
}

.plan li[data-later]::after {
    content: attr(data-later);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent-ink);
    background: var(--accent-wash);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: auto;
    white-space: nowrap;
    align-self: flex-start;
}

.no-ads {
    margin-top: 28px;
    text-align: center;
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(19px, 2.4vw, 24px);
    letter-spacing: -0.02em;
}

/* ----------------------------------------------------------------- quotes */

.pull {
    border-left: 3px solid var(--accent);
    padding-left: 22px;
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(21px, 2.8vw, 28px);
    line-height: 1.32;
    letter-spacing: -0.02em;
    color: var(--ink);
}

/* ------------------------------------------------------------------ close */

.close .wrap {
    display: grid;
    gap: 32px;
    align-items: center;
    grid-template-columns: 1fr;
}

@media (min-width: 860px) {
    .close .wrap { grid-template-columns: 1.1fr 0.9fr; }
}

.close img { width: min(300px, 100%); margin-inline: auto; }

/* ----------------------------------------------------------------- footer */

.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 40px;
    font-size: 15px;
    color: var(--ink-muted);
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    align-items: center;
    justify-content: space-between;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }

/* --------------------------------------------------------- legal document */

.doc { padding-block: clamp(40px, 6vw, 72px); }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); margin-bottom: 10px; }
.doc h2 { font-size: clamp(21px, 2.6vw, 25px); margin: 40px 0 12px; }
.doc p, .doc li { color: var(--ink-muted); }
.doc p + p { margin-top: 14px; }
.doc ul { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 9px; }
.doc .updated { font-family: var(--mono); font-size: 13px; color: var(--ink-faint); }

.doc-notice {
    margin-top: 26px;
    padding: 18px 20px;
    border-radius: var(--r-small);
    background: var(--accent-wash);
    border: 1px solid var(--border);
    color: var(--accent-ink);
    font-size: 15px;
}

/* Visually hidden, still announced by screen readers. */
.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;
}
