/* ── Shared site chrome: tokens + header + footer + document typography ──
   The design tokens are the card-deck kit ("Pressed Paper") ported from the
   app — same source of truth as /f/index.html's inline copy:
   firl/lib/presentation/features/carddeck/ui/cd_theme.dart (CdTheme +
   CdPalette) and presentation/theme/appearance.dart (kBrandAccent). The app
   mixes every neutral live from the accent (CdPalette._mix, 4-13%); a static
   page can't, so these are that mix precomputed against the fixed brand
   coral. Re-derive them if kBrandAccent ever moves — /f/index.html carries
   the same values inline and must move with this file.

   The chrome layout (sticky translucent header, three-block footer with a
   bottom line) follows the cwn-micropage shell; the skin is firl's. */

:root {
    color-scheme: light dark;

    /* kBrandAccent — coral, fixed for everyone. */
    --accent: #F05A6B;
    --on-accent: #ffffff;

    /* Warm cream paper, accent-cast (light). */
    --ink: #331E1B;
    --sub: #7C6861;
    --faint: #AF9D94;
    --bg: #F1E7E0;
    --surface: #FBF2EC;

    --divider: rgba(22, 20, 15, 0.12);
    --hair: rgba(22, 20, 15, 0.10);
}
@media (prefers-color-scheme: dark) {
    :root {
        /* Warm charcoal paper. Same accent-mix percentages. */
        --ink: #F3DDD9;
        --sub: #BDA8A0;
        --faint: #88776F;
        --bg: #251A16;
        --surface: #2A211B;

        --divider: rgba(251, 248, 241, 0.18);
        --hair: rgba(251, 248, 241, 0.14);
    }
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    /* The app renders San Francisco on iOS and the DM Sans brand face on
       Android; same resolution order here. */
    font-family: -apple-system, BlinkMacSystemFont, "DM Sans", Roboto,
        "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 60rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
    box-sizing: border-box;
}

/* ── Wordmark ─────────────────────────────────────────────────────────────
   CdWordmark: the lowercase name with a DOTLESS ı, plus the accent full
   stop resting on the baseline. Pinned to DM Sans in the app — a logo is a
   fixed letterform; platforms without it fall back to their own sans. */
.brand {
    font-family: "DM Sans", -apple-system, BlinkMacSystemFont, Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--ink);
    text-decoration: none;
}
.brand-dot {
    display: inline-block;
    width: 0.15em;
    height: 0.15em;
    margin-left: 0.04em;
    border-radius: 50%;
    background: var(--accent);
    /* Bottom margin edge on the alphabetic baseline — a true full stop. */
    vertical-align: baseline;
}

/* ── Header — the cwn glass bar on warm paper ────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.875rem 0;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--hair);
}
.site-header .brand {
    font-size: 20px;
}

/* ── Document typography (legal pages) ───────────────────────────────────── */
main.doc {
    max-width: 40rem;
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
    width: 100%;
    box-sizing: border-box;
}
main.doc h1 {
    font-size: 1.75rem;
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin: 0 0 1.5rem;
}
main.doc h2 {
    font-size: 1.15rem;
    line-height: 1.3;
    letter-spacing: -0.1px;
    margin: 2rem 0 0.75rem;
}
main.doc h3 {
    font-size: 1rem;
    line-height: 1.3;
    margin: 1.25rem 0 0.5rem;
}
main.doc p {
    margin: 0 0 1rem;
}
main.doc ul {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}
main.doc li {
    margin: 0 0 0.5rem;
}
main.doc a {
    color: var(--accent);
    overflow-wrap: break-word;
}
main.doc .doc-meta {
    color: var(--sub);
    font-size: 0.875rem;
    margin: -1rem 0 1.5rem;
}
.unavailable,
.muted {
    color: var(--sub);
}

/* ── Footer — cwn's three-block shell in footnote ink ───────────────────── */
.site-footer {
    margin-top: auto;
    padding: 2rem 0;
    border-top: 1px solid var(--divider);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.footer-app .brand {
    font-size: 17px;
}
.footer-app p {
    font-size: 13px;
    color: var(--sub);
    margin: 0.375rem 0 0;
}
.footer-links,
.footer-nav,
.footer-connect {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: baseline;
}
.footer-nav a,
.footer-connect a {
    font-size: 13px;
    color: var(--sub);
    text-decoration: none;
}
.footer-nav a:hover,
.footer-connect a:hover {
    color: var(--ink);
}
/* Mobile: one right-aligned column, brand on the left — never a link soup. */
@media (max-width: 640px) {
    .footer-links,
    .footer-nav,
    .footer-connect {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.875rem;
        flex-wrap: nowrap;
    }
}
.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hair);
}
.footer-bottom p {
    font-size: 13px;
    color: var(--faint);
    margin: 0;
}
