/**
 * The Excuse Bible.
 *
 * Deliberately not excusebot.io. The tool is a dark terminal that shows you one
 * thing; this is a book, and a book has paper, a measure, and verse numbers in
 * the margin. Same typeface — Newsreader carries both — different register.
 *
 * The page is a static document with no script of its own, so everything here
 * is layout and color. No state, no transitions that matter.
 */

:root {
  --paper: #FBF7EF;
  --ink: #1A1714;
  --ink-soft: #5C554B;
  --ink-faint: #8C8377;
  --rule: #E2D9C8;
  --accent: #7A2E1E;
  --accent-soft: #A85B44;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120F;
    --ink: #E8E1D5;
    --ink-soft: #A79E90;
    --ink-faint: #756C60;
    --rule: #2E2921;
    --accent: #D08A6E;
    --accent-soft: #B0705A;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Newsreader, Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.55;
  font-variant-numeric: oldstyle-num;
}

.sheet {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 2px; }
a:hover { text-decoration-color: var(--accent); }

/* ---- running head ---------------------------------------------------- */

.head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.head-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.head-name a { text-decoration: none; }
.head-name em { font-style: italic; letter-spacing: .02em; text-transform: none; font-size: 1.1em; }

.head-folio {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---- titling --------------------------------------------------------- */

.eyebrow {
  margin: 0 0 .5rem;
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

h1.title {
  margin: 0 0 .9rem;
  font-size: clamp(2rem, 6vw, 2.9rem);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -.015em;
}

.lede {
  margin: 0 0 1.6rem;
  max-width: var(--measure);
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.count {
  margin: 0 0 2.6rem;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: .8rem;
  border-top: 1px solid var(--rule);
}

/* ---- verses ----------------------------------------------------------- *
 * One line each. The corpus carries a reply and a comeback for every entry,
 * but a list of two thousand three-beat exchanges is a wall — the tool
 * performs them, the book just says them.
 */

.verses { margin: 0; padding: 0; list-style: none; }

.verse {
  display: grid;
  grid-template-columns: 2.4rem 1fr auto;
  align-items: baseline;
  gap: 0 .9rem;
  padding: .52rem 0;
  border-bottom: 1px solid var(--rule);
}
.verse:first-child { border-top: 1px solid var(--rule); }
.verse:hover { background: color-mix(in srgb, var(--accent) 3.5%, transparent); }

.verse-no {
  font-size: .74rem;
  color: var(--ink-faint);
  font-variant-numeric: lining-num tabular-nums;
  text-align: right;
}

.verse-text {
  font-size: 1.04rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.verse-stamp {
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

@media (max-width: 32rem) {
  .verse { grid-template-columns: 1.7rem 1fr; gap: 0 .55rem; }
  .verse-stamp { grid-column: 2; margin-top: .15rem; }
}

/* ---- indexes --------------------------------------------------------- */

.section { margin-top: 3.4rem; }

.section > h2 {
  margin: 0 0 1.1rem;
  font-size: .76rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--rule);
}

.toc { margin: 0; padding: 0; list-style: none; }

.toc li {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--rule);
}
.toc a { flex: 0 1 auto; text-decoration: none; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.toc .dots { flex: 1 1 auto; border-bottom: 1px dotted var(--rule); transform: translateY(-.22em); min-width: 1.5rem; }
.toc .n { flex: 0 0 auto; font-size: .78rem; color: var(--ink-faint); font-variant-numeric: lining-num tabular-nums; }
.toc .gloss { display: block; font-size: .85rem; color: var(--ink-faint); margin-top: .15rem; }
.toc li.stacked { display: block; }

.cols { columns: 2; column-gap: 2.2rem; }
.cols .toc li { break-inside: avoid; }
@media (max-width: 34rem) { .cols { columns: 1; } }

/* ---- callout to the tool --------------------------------------------- */

.tool {
  margin-top: 3.4rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.tool p { margin: 0 0 .7rem; color: var(--ink-soft); font-size: .97rem; max-width: var(--measure); }
.tool p:last-child { margin-bottom: 0; }
.tool strong { color: var(--ink); font-weight: 500; }
.tool a.go {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--accent);
  padding-bottom: .15rem;
}

/* ---- pagination ------------------------------------------------------ */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pager a { color: var(--accent); text-decoration: none; }
.pager span { color: var(--ink-faint); }

/* ---- colophon -------------------------------------------------------- */

footer.colophon {
  margin-top: 4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .6rem;
  font-size: .76rem;
  color: var(--ink-faint);
}
footer.colophon a { color: var(--ink-faint); }

@media (max-width: 30rem) {
  body { font-size: 18px; }
  .sheet { padding: 1.8rem 1.1rem 3.5rem; }
}
