/* Colors mirror src/contrast.mjs, which the build checks against WCAG AA. */
:root {
  --bg: #050505;
  --surface: #121110;
  --deep: #651e16;
  --text: #f4eee5;
  --muted: #bdb4a7;
  --gold: #ecab57;
  --orange: #e8774d;
  --on-gold: #050505;
  --btn: #ecab57;
  --line: #2c2a28;
  --display: "Bebas Neue", "Oswald", "Arial Narrow", Impact, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left));
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #faf6ee; --surface: #f0e8da; --text: #1f1b17; --muted: #5d544a;
    --gold: #8a4b05; --orange: #a8421a; --line: #d9cfbf; color-scheme: light;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.65 var(--body); overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--btn); color: var(--on-gold); padding: 10px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { top: 8px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; line-height: 1.02; margin: 0; }
h2 { font-size: clamp(2.1rem, 7vw, 3.2rem); margin-bottom: 1.1rem; }
h2::after { content: ""; display: block; width: 72px; height: 3px; background: var(--orange); margin-top: .7rem; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: 65ch; }
section { padding: 3.5rem 0; scroll-margin-top: 56px; }
.eyebrow { font: 600 .8rem/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 .9rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; }
.brand { font: 400 1.35rem/1 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand:hover { color: var(--gold); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 8px; font: 700 1rem/1 var(--body); text-decoration: none; border: 2px solid var(--btn); cursor: pointer; text-align: center; }
.btn--primary { background: var(--btn); color: var(--on-gold); }
.btn--primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn--secondary { background: transparent; color: var(--text); border-color: var(--line); }
.btn--secondary:hover { border-color: var(--gold); color: var(--text); }
.btn--disabled, .btn:disabled { background: transparent; color: var(--muted); border: 2px dashed var(--line); cursor: not-allowed; }
.btn--small { min-height: 36px; padding: 0 16px; font-size: .95rem; }

/* Hero */
.hero { padding: 1.75rem 0 3rem; }
.hero-grid { display: grid; gap: 1.5rem; justify-items: center; text-align: center; }
.cover { width: min(46vw, 200px); border-radius: 4px; box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.07); background: #000; }
.cover-placeholder { aspect-ratio: 2 / 3; display: flex; flex-direction: column; justify-content: space-between; padding: 8% 7%; text-align: center; background: #000; color: #fff; font-family: var(--display); text-transform: uppercase; }
.cover-placeholder .t { font-size: 1.5rem; line-height: 1; } .cover-placeholder .a { color: var(--gold); letter-spacing: .25em; font-size: 1rem; }
.hero h1 { font-size: clamp(2.3rem, 9vw, 4.6rem); }
.hero h1 .l { color: var(--gold); display: block; }
.hero .sub { font: 400 1.1rem/1.5 var(--body); color: var(--muted); max-width: 34ch; margin: .8rem auto 0; }
.byline { margin: .9rem 0 0; font: 600 1rem/1 var(--body); letter-spacing: .2em; text-transform: uppercase; }
.avail { margin: .6rem 0 0; color: var(--gold); font-weight: 600; }
.cta { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin-top: 1.4rem; }
.cta .btn--primary { width: min(100%, 320px); min-height: 52px; font-size: 1.1rem; }
.countdown { margin-top: 1.4rem; display: inline-flex; gap: 10px; }
.countdown[hidden] { display: none; }
.cd { min-width: 62px; padding: 8px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.cd b { display: block; font: 400 2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.cd span { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 820px) {
  .hero { padding: 3.5rem 0 4.5rem; }
  .hero-grid { grid-template-columns: auto 1fr; gap: 4rem; text-align: left; justify-items: start; align-items: center; }
  .cover { width: 330px; }
  .hero .sub { margin-left: 0; max-width: 40ch; font-size: 1.25rem; }
  .cta { flex-direction: row; gap: 1.5rem; }
  .cta .btn--primary { width: auto; min-width: 220px; }
}

/* Promise */
.promise p { font-size: 1.15rem; margin: 0 0 1.1rem; }
.promise p:first-of-type { font-size: 1.3rem; color: var(--text); }

/* TOC */
.part { margin-top: 2rem; }
.part h3 { font-size: 1.5rem; color: var(--gold); margin-bottom: .6rem; }
.chap { border-top: 1px solid var(--line); }
.part .chap:last-child { border-bottom: 1px solid var(--line); }
.chap summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr 24px; gap: 12px; align-items: center; padding: .85rem 0; min-height: 48px; }
.chap summary::-webkit-details-marker { display: none; }
.chap summary::after { content: "+"; font: 400 1.5rem/1 var(--display); color: var(--orange); text-align: center; }
.chap[open] summary::after { content: "\2212"; }
.chap .lab { display: block; font: 600 .72rem/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.chap .ttl { font-weight: 600; }
.chap p { margin: 0 0 1rem; color: var(--muted); max-width: 65ch; }
@media (min-width: 820px) { .chap summary { cursor: default; pointer-events: none; } .chap summary::after { display: none; } .chap summary { grid-template-columns: 1fr; padding-bottom: .2rem; } }

/* Buy */
.buy { background: var(--surface); }
.fmts { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.5rem; }
@media (min-width: 720px) { .fmts { grid-template-columns: repeat(3, 1fr); } .fmt--later { grid-column: 1 / -1; } }
.fmt { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 1.3rem; display: flex; flex-direction: column; gap: .5rem; }
.fmt-name { font-size: 1.9rem; }
.fmt-isbn { margin: 0; color: var(--muted); font-size: .9rem; }
.fmt-actions { margin-top: auto; padding-top: .8rem; display: flex; flex-direction: column; gap: .6rem; }
.fmt-actions .btn { width: 100%; }
.fmt-later { margin: 0; color: var(--muted); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; }
.fmt--later { flex-direction: row; align-items: center; justify-content: space-between; opacity: .9; }
.fmt--later .fmt-actions { margin: 0; padding: 0; }
.buy-note { color: var(--muted); font-size: .95rem; margin-top: 1rem; }

/* Foreword, praise */
.foreword { background: var(--deep); color: #f4eee5; }
.foreword h2::after { background: var(--gold); }
.foreword p { margin: 0; font-size: 1.15rem; max-width: 60ch; }
.foreword blockquote { margin: 1.5rem 0 0; padding-left: 1rem; border-left: 4px solid var(--gold); font: 400 1.7rem/1.2 var(--display); text-transform: uppercase; max-width: 28ch; }
.foreword blockquote cite { display: block; margin-top: .6rem; font: 400 .95rem/1.4 var(--body); text-transform: none; color: #d9cfc2; }
.praise-list { display: grid; gap: 1.2rem; margin-top: 1.4rem; }
@media (min-width: 720px) { .praise-list { grid-template-columns: repeat(2, 1fr); } }
.praise-list figure { margin: 0; padding: 1.3rem; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
.praise-list blockquote { margin: 0 0 .8rem; font-size: 1.1rem; }
.praise-list figcaption { color: var(--muted); font-size: .95rem; } .praise-list figcaption b { color: var(--text); }

/* About */
.about-grid { display: grid; gap: 1.5rem; }
.headshot { width: 180px; border-radius: 50%; aspect-ratio: 1; object-fit: cover; border: 3px solid var(--gold); }
@media (min-width: 720px) { .about-grid { grid-template-columns: 200px 1fr; gap: 3rem; align-items: start; } }

/* Signup */
.signup { background: var(--deep); color: #f4eee5; text-align: center; padding: 5rem 0; }
.signup h2::after { background: #ecab57; margin-left: auto; margin-right: auto; }
.signup .prose { margin-left: auto; margin-right: auto; color: #f0d9c9; }
.signup a { color: #ecab57; }
.signup a:hover { color: #fff; }
.signup .btn--secondary { color: #f4eee5; border-color: #f0d9c9; }
.consent { margin: 0; color: var(--muted); font-size: .9rem; max-width: 52ch; }

/* Footer */
footer { padding: 2.5rem 0 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
footer .wrap { display: grid; gap: .6rem; }
footer p { margin: 0; } footer a { color: var(--muted); } footer a:hover { color: var(--text); }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.tiny { font-size: .8rem; }
.page { padding: 2.5rem 0 4rem; } .page h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); margin-bottom: 1rem; } .page h2 { font-size: 1.8rem; margin-top: 2rem; } .page h2::after { display: none; }

.signup .embed { display: block; width: 100%; max-width: 520px; margin: 1.6rem auto 1rem; border: 0; border-radius: 14px; background: #fff; color-scheme: light; box-shadow: 0 24px 60px -20px rgba(0,0,0,.55); }
.signup .consent { margin: .6rem auto 0; color: #f0d9c9; max-width: 52ch; }
.lm { margin: 1rem 0 0; }

.consent-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px var(--gutter); background: var(--surface); border-top: 1px solid var(--line); font-size: .9rem; }
.consent-bar p { margin: 0; max-width: 60ch; }
.consent-bar div { display: flex; gap: 8px; }
