/* =========================================================================
   THE FAITHFUL RENDER — styles.css
   Static presentation. No framework, no build step, no JS dependency.
   Aesthetic: dark, elegant, forensic. A courtroom at one in the morning —
   freeze-frame light, evidence-tape lines, ink on cold paper.
   ========================================================================= */

/* ----- design tokens ----- */
:root {
  --ink:        #ECE7DF;  /* warm bone — primary text on dark */
  --ink-soft:   #B7B0A6;  /* secondary text */
  --ink-faint:  #7E7872;  /* captions, meta */
  --paper:      #0B0C10;  /* near-black, faint blue — the screen at 1 a.m. */
  --paper-2:    #111319;  /* raised surface */
  --paper-3:    #171a22;  /* card / rail */
  --line:       #262a33;  /* hairlines */
  --line-soft:  #1d212a;

  --gold:       #C9A24B;  /* brass / oath seal — the one warm accent */
  --gold-dim:   #9c7d39;
  --red:        #9E2B25;  /* evidence red — used sparingly */
  --red-bright: #C5453C;

  --serif:  "Spectral", Georgia, "Times New Roman", serif;
  --display: "Cormorant Garamond", Georgia, serif;

  --measure: 38rem;          /* reading column */
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rule: 1px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 80% at 50% -10%, #15171f 0%, rgba(11,12,16,0) 60%),
    linear-gradient(180deg, #0d0e13 0%, var(--paper) 30%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: 0.002em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: min(72rem, 100% - (2 * var(--gutter)));
  margin-inline: auto;
}

a { color: var(--gold); text-decoration: none; }
a:hover, a:focus-visible { color: #e3c172; text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
  font-family: var(--display);
  letter-spacing: 0.04em;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.nowrap { white-space: nowrap; }

/* =========================================================================
   LANDING PAGE
   ========================================================================= */

/* ---- thin brass rule that frames the top of the page ---- */
.page-top-rule {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-dim) 18%, var(--gold) 50%, var(--gold-dim) 82%, transparent);
  opacity: 0.85;
}

/* ---- HERO ---- */
.hero {
  position: relative;
  padding: clamp(4rem, 12vh, 9rem) 0 clamp(3rem, 8vh, 6rem);
  overflow: hidden;
}

.hero::before {
  /* faint freeze-frame timecode crosshair, evoking the 14:22 tape */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(201,162,75,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(201,162,75,0.05) 1px, transparent 1px);
  background-size: 4.5rem 4.5rem;
  mask-image: radial-gradient(60% 60% at 50% 35%, #000 0%, transparent 75%);
  pointer-events: none;
}

.hero__inner { position: relative; text-align: center; }

.eyebrow {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.42em;
  font-size: 0.78rem;
  color: var(--gold);
  margin: 0 0 1.6rem;
  padding-left: 0.42em;
}

.hero h1.book-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3rem, 11vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: 0.005em;
  margin: 0;
  color: var(--ink);
  text-wrap: balance;
}

.hero h1.book-title .the {
  display: block;
  font-size: 0.32em;
  letter-spacing: 0.55em;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
  padding-left: 0.55em;
}

.byline {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  color: var(--ink-soft);
  margin: 1.4rem 0 0;
}

/* shelf-talker — the lead line */
.shelf-talker {
  position: relative;
  max-width: 34rem;
  margin: 2.8rem auto 0;
  padding: 1.8rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  font-weight: 500;
  line-height: 1.28;
  color: var(--ink);
  text-wrap: balance;
}
.shelf-talker::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 3.5rem;
  height: 2px;
  background: var(--gold);
}
.shelf-talker em { color: var(--gold); font-style: italic; }

.hero__cta {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.92rem;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.btn--primary {
  background: var(--gold);
  color: #0b0c10;
  border-color: var(--gold);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: #e3c172;
  color: #0b0c10;
  text-decoration: none;
  transform: translateY(-1px);
}
.btn--ghost { color: var(--ink); background: transparent; }
.btn--ghost:hover, .btn--ghost:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
}
.btn .arrow { font-size: 1.1em; line-height: 1; }

/* ---- generic section scaffolding ---- */
.section { padding: clamp(3.5rem, 9vh, 6.5rem) 0; }
.section--tint { background: var(--paper-2); border-block: var(--rule) solid var(--line-soft); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 2.4rem;
}
.section-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
}
.section-head .num {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  align-self: center;
}

/* ---- BLURB ---- */
.blurb {
  max-width: var(--measure);
  margin-inline: auto;
}
.blurb p {
  font-size: 1.18rem;
  line-height: 1.78;
  margin: 0 0 1.3rem;
  color: var(--ink);
}
.blurb p:first-of-type { font-size: 1.26rem; }
.blurb .lede-cap::first-letter {
  font-family: var(--display);
  font-weight: 600;
  font-size: 3.6em;
  float: left;
  line-height: 0.78;
  padding: 0.08em 0.12em 0 0;
  color: var(--gold);
}
.blurb em { color: #e7dfcd; font-style: italic; }
.blurb .pull {
  font-family: var(--display);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.34;
  color: var(--ink);
  text-align: center;
  border-block: 1px solid var(--line);
  padding: 1.8rem 0;
  margin: 2.6rem 0;
  text-wrap: balance;
}
.blurb .pull strong { color: var(--gold); font-weight: 600; font-style: normal; }

/* ---- COMPS ---- */
.comps-lead {
  max-width: var(--measure);
  margin: 0 auto 2.6rem;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  line-height: 1.4;
  text-align: center;
  color: var(--ink);
  text-wrap: balance;
}
.comps-lead strong { color: var(--gold); font-style: normal; font-weight: 600; }

.comps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.comp {
  background: var(--paper-3);
  padding: 1.6rem 1.5rem;
}
.comp h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.comp h3 cite { font-style: italic; color: var(--gold); }
.comp p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.comps-foot {
  max-width: var(--measure);
  margin: 2.4rem auto 0;
  text-align: center;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.comps-foot strong { color: var(--ink); font-weight: 500; }

/* ---- FACTS strip ---- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.5rem 2rem;
  max-width: 60rem;
  margin-inline: auto;
}
.fact { text-align: center; }
.fact dt {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.fact dd {
  margin: 0;
  font-family: var(--display);
  font-size: 1.18rem;
  color: var(--ink);
  line-height: 1.3;
}

/* ---- THE TEAM / PRODUCTION NOTE ---- */
.note-card {
  max-width: 52rem;
  margin-inline: auto;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: clamp(1.8rem, 4vw, 2.8rem);
}
.note-card + .note-card { margin-top: 1.5rem; }
.note-card.flag { border-left-color: var(--red); }
.note-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0 0 0.9rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.note-card.flag h3 { color: #e8a59f; }
.note-card .tag {
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.28em 0.7em;
  border-radius: 2px;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
}
.note-card.flag .tag { border-color: var(--red); color: var(--red-bright); }
.note-card p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 1.04rem;
  line-height: 1.7;
}
.note-card p:last-child { margin-bottom: 0; }
.note-card strong { color: var(--ink); font-weight: 500; }
.note-card em { color: #e7dfcd; }

/* ---- closing CTA band ---- */
.closer {
  text-align: center;
  padding: clamp(4rem, 10vh, 7rem) 0;
  border-top: 1px solid var(--line);
}
.closer .mark {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  line-height: 1.3;
  max-width: 30rem;
  margin: 0 auto 2.2rem;
  color: var(--ink);
  text-wrap: balance;
}
.closer .mark strong { color: var(--gold); font-style: normal; font-weight: 600; }

/* ---- FOOTER ---- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 2.6rem 0 3.4rem;
  background: var(--paper);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
}
.site-foot p { margin: 0; font-size: 0.86rem; color: var(--ink-faint); line-height: 1.6; }
.site-foot .foot-title {
  font-family: var(--display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

/* =========================================================================
   READER (manuscript.html)
   ========================================================================= */

.reader-masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11,12,16,0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.reader-masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.back-home {
  font-family: var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.back-home:hover { color: var(--gold); text-decoration: none; }
.reader-kicker {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--gold);
}

.reader-shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-block: clamp(2.5rem, 6vh, 4.5rem);
}

.chapter-rail {
  position: sticky;
  top: 5rem;
  font-size: 0.92rem;
}
.rail-title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 0 0 1rem;
}
.chapter-rail ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.chapter-rail li { margin: 0; }
.chapter-rail a {
  display: block;
  padding: 0.55rem 0 0.55rem 1rem;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--ink-soft);
}
.chapter-rail a:hover, .chapter-rail a:focus-visible {
  color: var(--ink);
  border-left-color: var(--gold);
  text-decoration: none;
}
.nav-num {
  display: block;
  font-family: var(--display);
  font-style: italic;
  color: var(--gold);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}
.nav-name { display: block; font-size: 0.98rem; }
.rail-note {
  margin: 1.6rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-faint);
  line-height: 1.6;
}
.rail-note span { color: var(--ink-soft); }

/* the manuscript column itself */
.manuscript { max-width: var(--measure); }

.chapter { margin-bottom: 4.5rem; }
.chapter h1 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0 0 2.2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 5rem;
}
.chapter h1 .ch-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  color: var(--gold);
  margin-bottom: 0.7rem;
}
.chapter h1 .ch-name {
  display: block;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.manuscript p {
  margin: 0 0 1.35rem;
  text-align: left;
  hyphens: auto;
}
/* first paragraph of each chapter: drop cap + no indent */
.chapter > p:first-of-type::first-letter {
  font-family: var(--display);
  font-weight: 600;
  font-size: 3.5em;
  float: left;
  line-height: 0.78;
  padding: 0.06em 0.14em 0 0;
  color: var(--gold);
}
/* indented continued paragraphs (book feel), but not after a break/heading */
.manuscript p + p { text-indent: 1.4em; }
.manuscript p { margin-bottom: 1.35rem; }
.manuscript em { color: #e7dfcd; font-style: italic; }

.manuscript blockquote {
  margin: 1.6rem 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--gold-dim);
  color: var(--ink-soft);
  font-style: italic;
}
.manuscript blockquote p { text-indent: 0; }

/* scene break — three brass marks */
.scene-break {
  border: 0;
  height: auto;
  text-align: center;
  margin: 2.4rem auto;
  width: 100%;
}
.scene-break::before {
  content: "\2766"; /* floral heart bullet */
  display: block;
  color: var(--gold-dim);
  font-size: 1.1rem;
  letter-spacing: 0.6em;
  text-indent: 0.6em;
}
/* paragraph that follows a scene break shouldn't indent */
.scene-break + p { text-indent: 0; }
.scene-break + p::first-letter { color: inherit; }

.reader-end { margin-top: 3rem; text-align: center; }
.scene-break.end::before { content: "\2014\00a0\2766\00a0\2014"; }
.end-note {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.82rem;
  color: var(--gold);
  margin: 1.4rem 0 1rem;
}
.end-sub { color: var(--ink-soft); font-size: 1rem; max-width: 30rem; margin: 0 auto 1.4rem; }
.end-back { font-family: var(--display); letter-spacing: 0.06em; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 60rem) {
  .reader-shell { grid-template-columns: 1fr; }
  .chapter-rail {
    position: static;
    top: auto;
    margin-bottom: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
  }
  .chapter-rail ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    border-left: 0;
  }
  .chapter-rail a {
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 2px;
    margin-left: 0;
  }
  .nav-num { display: inline; }
  .nav-name { display: inline; margin-left: 0.4rem; }
  .rail-note { display: none; }
}

@media (max-width: 40rem) {
  body { font-size: 1.02rem; }
  .hero h1.book-title .the { letter-spacing: 0.4em; }
  .section-head { flex-direction: column; gap: 0.4rem; align-items: flex-start; }
  .section-head::after { display: none; }
  .blurb p:first-of-type { font-size: 1.16rem; }
  .site-foot .wrap { flex-direction: column; gap: 0.6rem; }
  .chapter > p:first-of-type::first-letter,
  .blurb .lede-cap::first-letter { font-size: 3em; }
}

/* print: give a clean reading/proofing artifact */
@media print {
  body { background: #fff; color: #111; font-size: 11.5pt; }
  .reader-masthead, .chapter-rail, .site-foot, .hero__cta, .skip-link { display: none; }
  .reader-shell { display: block; }
  .manuscript, .blurb { max-width: none; }
  a { color: #111; text-decoration: none; }
  .chapter h1 .ch-label, .chapter h1 .ch-name, .blurb .lede-cap::first-letter { color: #111; }
  .scene-break::before { color: #111; }
}
