/*
 * The public site. Palette, type and layout language come from docs/persona.md, section 6.
 *
 * Theme: the reader's system setting decides, unless they have chosen Dark or Light with the
 * switcher in the footer. The choice is kept in localStorage (never a cookie, so the site still
 * sets nothing and needs no banner) and applied by /site/theme.js before the first paint.
 * With no JavaScript the switcher is not shown and the system setting still rules, in CSS alone.
 *
 * Two shades here are derived rather than taken from the persona, both for readability on the
 * light ground: --ink-quiet is a darker secondary ink (the persona's #75687a falls just under
 * 4.5:1 on paper), and --edge gives a card an outline, because the light card and the light
 * ground are a shade apart. --accent-ink is the apricot darkened until it can carry text on
 * paper, used where the accent is type rather than a ground; on a light accent ground the text
 * is the palette's own aubergine, not its cream, which the cream cannot manage at 2.8:1.
 * Everything else is the persona's own.
 *
 * Nothing here is built by Vite: the production image never runs npm, and a marketing page that
 * depends on a build step is a page that breaks on a deploy.
 *
 * Fonts are served from this origin. Nothing on this site is loaded from a third party, nothing
 * is measured, and no cookie is set, which is why there is no cookie banner.
 */

@font-face {
    font-family: 'Bricolage Grotesque';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/site/fonts/bricolage-grotesque.woff2') format('woff2');
}

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/site/fonts/public-sans.woff2') format('woff2');
}

/* Light, the default when the system asks for light or says nothing either way. */
:root {
    color-scheme: light dark;

    --ground: #f3ebe3;
    --card: #e8dcd3;
    --card-2: #dccbc0;
    --edge: #cbb9ac;
    --ink: #2a1f2d;
    --ink-quiet: #5f5464;
    --rule: #dbd0c8;
    --accent: #cf7a48;
    --accent-ink: #7a3f1b;
    --on-accent: #2a1f2d;

    --title: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
    --body: 'Public Sans', 'Helvetica Neue', Arial, sans-serif;
    --tile: 16px;

    /* One horizontal rhythm for the masthead, the page and the footer. */
    --gutter: clamp(1rem, 3.5vw, 2.5rem);
    --page-width: 76rem;
    --measure: 37rem;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        color-scheme: dark;

        --ground: #2a1f2d;
        --card: #372c3a;
        --card-2: #463a4a;
        --edge: #463a4a;
        --ink: #f3ebe3;
        --ink-quiet: #b3a6b0;
        --rule: #463a4a;
        --accent: #e2915f;
        --accent-ink: #e2915f;
        --on-accent: #2a1f2d;
    }
}

:root[data-theme='dark'] {
    color-scheme: dark;

    --ground: #2a1f2d;
    --card: #372c3a;
    --card-2: #463a4a;
    --edge: #463a4a;
    --ink: #f3ebe3;
    --ink-quiet: #b3a6b0;
    --rule: #463a4a;
    --accent: #e2915f;
    --accent-ink: #e2915f;
    --on-accent: #2a1f2d;
}

:root[data-theme='light'] {
    color-scheme: light;
}

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

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

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/*
 * The page is one column on a reading page and a wide one on the landing page, and the masthead,
 * the content and the footer all sit inside it, so they share an edge at every width.
 */
.page {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 1.75rem var(--gutter) 4rem;
}

.page.wide {
    --measure: 34rem;
}

/* A page of prose keeps its own column inside the same frame, centred, so the spare
   width falls evenly on both sides instead of pooling on the right. */
.page:not(.wide) main {
    max-width: 42rem;
    margin-inline: auto;
}

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
}

.masthead a.lockup {
    display: inline-flex;
    line-height: 0;
}

.masthead img {
    height: 40px;
    width: auto;
    border-radius: 10px;
}

/* Artwork comes in two treatments; the theme picks one, the same way the palette does. */
.lockup .on-dark,
.hero-art .on-dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .lockup .on-dark,
    :root:not([data-theme='light']) .hero-art .on-dark {
        display: inline;
    }

    :root:not([data-theme='light']) .lockup .on-light,
    :root:not([data-theme='light']) .hero-art .on-light {
        display: none;
    }
}

:root[data-theme='dark'] .lockup .on-dark,
:root[data-theme='dark'] .hero-art .on-dark {
    display: inline;
}

:root[data-theme='dark'] .lockup .on-light,
:root[data-theme='dark'] .hero-art .on-light {
    display: none;
}

nav.station {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

nav.station a {
    color: var(--ink-quiet);
    text-decoration: none;
}

nav.station a:hover,
nav.station a:focus-visible {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 4px;
}

h1,
h2,
h3 {
    font-family: var(--title);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 0.75rem;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.1rem, 5vw, 3.2rem);
}

h2 {
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    margin-top: 2.5rem;
}

h3 {
    font-size: 1.1rem;
    margin-top: 1.75rem;
}

p,
ul,
ol,
dl.legal dd,
table.legal {
    max-width: var(--measure);
}

a {
    color: var(--ink);
    text-decoration-color: var(--accent-ink);
    text-underline-offset: 3px;
}

.lede {
    font-size: clamp(1.1rem, 2.4vw, 1.25rem);
    color: var(--ink);
}

.quiet {
    color: var(--ink-quiet);
}

.station-line {
    font-family: var(--title);
    color: var(--accent-ink);
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 1rem;
}

/* The landing page's opening: one column of copy, held to a readable measure. */
.hero {
    display: grid;
    gap: 2.5rem;
    align-items: start;
    padding: 1.5rem 0 1rem;
}

@media (min-width: 60rem) {
    .hero {
        grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
        gap: 3.5rem;
        padding: 2.5rem 0 1.5rem;
    }
}

.calls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0 0;
}

.button {
    display: inline-block;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
    padding: 0.85rem 1.5rem;
    border: 0;
    border-radius: var(--tile);
    font-size: 1rem;
    font-family: var(--body);
    cursor: pointer;
}

.button:hover,
.button:focus-visible {
    filter: brightness(1.12);
}

.button.quietly {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--edge);
}

.not-yet {
    display: inline-block;
    border: 1px dashed var(--edge);
    border-radius: var(--tile);
    padding: 0.85rem 1.5rem;
    color: var(--ink-quiet);
}

.card {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--tile);
}

.panel-head {
    font-family: var(--title);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-quiet);
    margin: 0 0 1rem;
}

.tile {
    aspect-ratio: 1;
    border-radius: var(--tile);
    background: var(--card-2);
    display: grid;
    place-items: center;
    font-family: var(--title);
    font-size: 1.25rem;
    color: var(--ink);
    max-width: none;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
    max-width: none;
}

/* Wide enough for the whole house in one row, the way a shelf row reads in the app. */
@media (min-width: 78rem) {
    .features {
        grid-template-columns: repeat(5, 1fr);
    }
}

.features li {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--tile);
    padding: 1.1rem 1.2rem;
    max-width: none;
}

.features h3 {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
}

.features p {
    margin: 0;
    color: var(--ink-quiet);
    font-size: 0.95rem;
    max-width: none;
}

/* Two pieces of prose side by side on a wide screen, one under the other on a narrow one.
   The min() keeps the 22rem track from outgrowing a 360px screen and pushing the page sideways. */
.spread {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr));
    gap: 0.5rem 3.5rem;
}

.spread > section > h2 {
    margin-top: 2.5rem;
}

.note {
    background: var(--card);
    border: 1px solid var(--edge);
    border-left: 3px solid var(--accent-ink);
    border-radius: var(--tile);
    padding: 1rem 1.2rem;
    margin: 0 0 2rem;
    max-width: var(--measure);
    color: var(--ink-quiet);
    font-size: 0.95rem;
}

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

.panel {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--tile);
    padding: 1.5rem;
    max-width: var(--measure);
}

label {
    display: block;
    margin: 1rem 0 0.4rem;
    font-size: 0.95rem;
    color: var(--ink-quiet);
}

input[type='text'],
input[type='email'],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--tile);
    border: 1px solid var(--edge);
    background: var(--ground);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1rem;
}

textarea {
    min-height: 9rem;
    resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 2px;
}

.error {
    color: var(--accent-ink);
    font-size: 0.95rem;
    margin: 0.4rem 0 0;
}

.said {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--tile);
    padding: 1.2rem 1.4rem;
    max-width: var(--measure);
}

dl.legal dt {
    font-family: var(--title);
    font-weight: 600;
    margin-top: 1.25rem;
}

dl.legal dd {
    margin: 0.25rem 0 0;
    color: var(--ink-quiet);
}

table.legal {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.95rem;
}

table.legal th,
table.legal td {
    text-align: left;
    padding: 0.6rem 0.8rem 0.6rem 0;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

table.legal th {
    font-family: var(--title);
    font-weight: 600;
    width: 11rem;
}

@media (max-width: 40rem) {
    table.legal,
    table.legal tbody,
    table.legal tr,
    table.legal th,
    table.legal td {
        display: block;
        width: auto;
    }

    table.legal th {
        border-bottom: 0;
        padding-bottom: 0.2rem;
    }
}

footer.station {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-quiet);
    font-size: 0.9rem;
    display: flex;
    gap: 1rem 1.25rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

footer.station nav {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

footer.station a {
    color: var(--ink-quiet);
}

/* The theme switcher. Hidden until theme.js says it can do anything. */
.theme-switch {
    display: none;
    align-items: center;
    gap: 0.4rem;
}

[data-js='on'] .theme-switch {
    display: flex;
}

.theme-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-quiet);
    background: transparent;
    border: 1px solid var(--edge);
    border-radius: 999px;
    padding: 0.35rem;
    cursor: pointer;
    line-height: 0;
}

.theme-switch svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-switch button:hover {
    color: var(--ink);
}

.theme-switch button[aria-pressed='true'] {
    background: var(--card);
    border-color: var(--accent-ink);
    color: var(--ink);
}

.centre {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.centre .page {
    width: 100%;
    max-width: 30rem;
}

@media (max-width: 32rem) {
    body {
        font-size: 16px;
    }

    .page {
        padding: 1.25rem var(--gutter) 3rem;
    }

    .masthead img {
        height: 34px;
    }
}

/* The mark beside the opening copy. Decoration: it is hidden from the reading order,
   and on a narrow screen it goes entirely rather than pushing the copy down. */
.hero-art {
    display: none;
}

@media (min-width: 60rem) {
    .hero-art {
        display: grid;
        place-items: center;
        padding-top: 1rem;
    }

    .hero-art img {
        width: min(100%, 15rem);
        height: auto;
        border-radius: 2.2rem;
    }
}

/* Google's badge, placed as supplied: no colours, corners or padding of ours on top of it. */
.play-badge {
    display: inline-block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
}

.play-badge img {
    width: auto;
    height: 3.4rem;
}

dialog.note {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(28rem, calc(100vw - 2.5rem));
    max-height: calc(100vh - 2.5rem);
    border: 1px solid var(--edge);
    border-radius: 1rem;
    background: var(--card);
    color: var(--ink);
    padding: 1.75rem;
}

.note-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    margin: 0;
}

dialog.note h2 {
    padding-right: 2rem;
}

.note-close button {
    display: inline-flex;
    padding: 0.35rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-quiet);
    cursor: pointer;
    line-height: 0;
}

.note-close button:hover {
    color: var(--ink);
}

.note-close svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

dialog.note,
dialog.note::backdrop {
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        display 0.18s allow-discrete,
        overlay 0.18s allow-discrete;
}

dialog.note {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.98);
}

dialog.note[open] {
    opacity: 1;
    transform: none;
}

@starting-style {
    dialog.note[open] {
        opacity: 0;
        transform: translateY(0.5rem) scale(0.98);
    }
}

dialog.note::backdrop {
    background: rgb(0 0 0 / 0.45);
    opacity: 0;
}

dialog.note[open]::backdrop {
    opacity: 1;
}

@starting-style {
    dialog.note[open]::backdrop {
        opacity: 0;
    }
}

/* The badge in the footer, a size down from the ones in the page. */
.footer-play .play-badge img {
    height: 2.5rem;
}

@media (prefers-reduced-motion: reduce) {
    dialog.note,
    dialog.note::backdrop {
        transition: none;
    }
}

dialog.note h2 {
    margin-top: 0;
}

dialog.note form {
    margin-top: 1.25rem;
}

/* Placeholders are hints, not values: quieter than what the visitor types. */
input::placeholder,
textarea::placeholder {
    color: var(--ink-quiet);
    opacity: 0.75;
}

/*
 * "What a membership gives you": the terms of the thing, set as a shelf of rows rather than a
 * list of bullets. Same card, edge and corner as .features, and the aside's apricot spine from
 * .note, so it belongs to the page instead of sitting on top of it. One row per promise; the
 * term and its gloss stack on a narrow screen and sit side by side from 30rem up.
 */
.gives {
    background: var(--card);
    border: 1px solid var(--edge);
    border-left: 3px solid var(--accent-ink);
    border-radius: var(--tile);
    padding: 1.2rem 1.3rem;
    margin: 1.5rem 0 0;
    max-width: var(--measure);
}

.gives .panel-head {
    margin-bottom: 0.9rem;
}

.gives ul {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: none;
}

.gives li {
    display: grid;
    gap: 0.1rem 1.25rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--edge);
}

.gives li:first-child {
    border-top: 0;
    padding-top: 0;
}

.gives .term {
    font-family: var(--title);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    color: var(--ink);
}

.gives .gloss {
    color: var(--ink-quiet);
    font-size: 0.95rem;
}

@media (min-width: 30rem) {
    .gives li {
        grid-template-columns: minmax(0, 11.5rem) minmax(0, 1fr);
        align-items: baseline;
    }
}

.gives-foot {
    margin: 0.9rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--edge);
    font-size: 0.95rem;
    max-width: none;
}
