/* Chapter And Verse — one stylesheet, both themes.
 *
 * Paper and ink. Serif for anything that is scripture or the verdict, sans for
 * the rest. The clay accent is the app's own AccentColor. Every colour is
 * defined on bare :root first because the default "follow the system" state
 * stamps no attribute at all. No web fonts: the site makes zero requests to
 * anyone but Cloudflare, which is the same promise the app makes.
 *
 * Contrast: every text/ground pair clears WCAG AA in both themes. The clay is
 * 4.6:1 on the light paper and is lightened for dark, where it lands at 7.1:1.
 */

:root {
    color-scheme: light dark;
    --paper:      #f9f3f6;
    --paper-2:    #f2e9ee;
    --card:       #ffffff;
    --line:       #e6d8de;
    --line-firm:  #cdb7c1;

    --ink:        #1f1417;
    --ink-2:      #5a454c;   /* 7.2:1 */
    --ink-3:      #6f5a61;   /* 5.3:1 */

    --clay:       #9b5a3b;   /* 4.6:1 on --paper */
    --clay-hi:    #7e4429;
    --on-clay:    #fff8f4;
    --against:    #6d6266;

    --shadow: 0 1px 2px rgb(31 20 23 / .05), 0 10px 28px -14px rgb(31 20 23 / .22);
    --page: 1040px;
    --measure: 64ch;
    --radius: 14px;

    --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
    --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper:     #141114;
        --paper-2:   #1c171b;
        --card:      #211b1f;
        --line:      #372d33;
        --line-firm: #524249;
        --ink:       #f3ebee;
        --ink-2:     #c9b9c0;
        --ink-3:     #ab9aa2;
        --clay:      #d9a27f;   /* 7.1:1 on the dark paper */
        --clay-hi:   #e6b797;
        --on-clay:   #1f1417;
        --against:   #a3959b;
        --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -14px rgb(0 0 0 / .6);
    }
}
:root[data-theme="dark"] {
    --paper:     #141114;
    --paper-2:   #1c171b;
    --card:      #211b1f;
    --line:      #372d33;
    --line-firm: #524249;
    --ink:       #f3ebee;
    --ink-2:     #c9b9c0;
    --ink-3:     #ab9aa2;
    --clay:      #d9a27f;
    --clay-hi:   #e6b797;
    --on-clay:   #1f1417;
    --against:   #a3959b;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -14px rgb(0 0 0 / .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
a { color: var(--clay); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--clay-hi); }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }
.muted { color: var(--ink-2); }
.small { font-size: .92rem; color: var(--ink-3); }
.verse { font-family: var(--serif); font-size: 1.08em; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 10; }

.wrap { width: min(var(--page), 100% - 40px); margin: 0 auto; }
.narrow { max-width: 720px; }
.centred { text-align: center; }
.centred p { margin-left: auto; margin-right: auto; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a { text-decoration: none; color: var(--ink-2); padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }

/* bands */
.band { padding: 72px 0; }
.band.tint { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band.hero { padding: 88px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero .lede { font-size: 1.25rem; color: var(--ink-2); }
.hero .phone { justify-self: center; width: min(300px, 80vw); border-radius: 36px; box-shadow: var(--shadow); border: 1px solid var(--line-firm); }
@media (max-width: 800px) { .hero .wrap { grid-template-columns: 1fr; } .band { padding: 56px 0; } }

/* buttons */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; font-size: 1rem; }
.btn-primary { background: var(--clay); color: var(--on-clay); }
.btn-primary:hover { background: var(--clay-hi); color: var(--on-clay); }
.btn-ghost { border-color: var(--line-firm); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }

/* cards + grids */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; display: grid; gap: 18px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step::before { counter-increment: step; content: counter(step); font-family: var(--serif); font-size: 1.4rem; font-weight: 600; color: var(--clay); width: 44px; height: 44px; border: 1.5px solid var(--line-firm); border-radius: 50%; display: grid; place-items: center; }
.step p { margin: 0; }

/* the verdict demo */
.verdict { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow); max-width: 560px; }
.verdict .line { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0 0 14px; }
.verdict .bar { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; }
.verdict .bar span:first-child { background: var(--clay); }
.verdict .bar span:last-child { background: var(--against); opacity: .45; flex: 1; }
.verdict .pct { display: flex; justify-content: space-between; margin: 10px 0 0; font-weight: 600; font-size: .95rem; }
.verdict .pct .for { color: var(--clay); }
.verdict .pct .against { color: var(--ink-2); }
.verdict .note { margin: 6px 0 0; font-size: .8rem; color: var(--ink-3); }

/* screenshots */
.shots { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.shots figure { margin: 0; }
.shots img { border-radius: 28px; border: 1px solid var(--line-firm); box-shadow: var(--shadow); }
.shots figcaption { margin-top: 10px; font-size: .95rem; color: var(--ink-2); }

/* the letter */
.letter { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(28px, 6vw, 56px); box-shadow: var(--shadow); max-width: 720px; margin: 0 auto; }
.letter-greeting { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.letter-body p { max-width: none; }
.letter-signoff { margin-top: 32px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.signature-mark { width: 200px; height: 64px; color: var(--ink); display: block; }
.letter-signoff .who { font-size: .95rem; color: var(--ink-2); }
.letter-signoff .who strong { display: block; color: var(--ink); font-size: 1.05rem; }

/* prose pages */
.prose h2 { margin-top: 2em; }
.prose ul { padding-left: 1.2em; max-width: var(--measure); }
.prose li { margin-bottom: .4em; }
.prose table { border-collapse: collapse; width: 100%; max-width: 760px; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink-2); font-weight: 600; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: .95rem; color: var(--ink-2); }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.site-foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot p { margin: 4px 0 0; }

/* small screens: brand on one line, nav becomes a tidy row underneath */
@media (max-width: 700px) {
    .site-head { position: static; }
    .site-head .wrap { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 0; }
    .brand { white-space: nowrap; }
    .site-nav { justify-content: flex-start; gap: 2px; margin-left: -10px; }
    .site-nav a { font-size: .9rem; padding: 5px 9px; }
    .hero .phone { width: min(260px, 70vw); }
    .site-foot .wrap { flex-direction: column; }
}
