/* The Deliberate Text - shared stylesheet for every page */
:root {
  --paper: #f7f8f6; --ink: #1d2531; --muted: #5b6573; --rule: #cfd5dc;
  --accent: #2b4a7e; --accent-soft: #e6ebf3;
  --band: #1f3a68; --band-ink: #f3f5f9; --band-muted: #c3cfe4; --gold: #c9a43a;
  --part1: #2b4a7e; --part2: #1f7a6d; --part3: #8c2f45;
  --part1-soft: #e8edf6; --part2-soft: #e4f2ef; --part3-soft: #f6e8ec;
  --part4: #85651a; --part4-soft: #f5efdf;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141922; --ink: #e2e6eb; --muted: #9aa4b2; --rule: #2f3846;
    --accent: #a3b9e3; --accent-soft: #1e2736;
    --band: #1b2d4f; --band-ink: #eef2f8; --band-muted: #a9b9d6; --gold: #d8b85a;
    --part1: #a3b9e3; --part2: #7cc9bb; --part3: #e39aac;
    --part1-soft: #1c2638; --part2-soft: #17292a; --part3-soft: #2b1c23;
    --part4: #d8b85a; --part4-soft: #2a2416;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Literata", "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  font-size: 1.125rem; line-height: 1.7;
}
:lang(he) { font-family: "Frank Ruhl Libre", "Literata", "David", serif; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header { background: var(--band); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.5rem 2rem; padding-top: 1.1rem; padding-bottom: 1.1rem;
}
.site-name { font-weight: 600; font-size: 1.05rem; color: var(--band-ink); text-decoration: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { color: var(--band-muted); text-decoration: none; font-size: 1rem; padding-bottom: 0.3rem; border-bottom: 3px solid transparent; }
.site-nav a:hover { color: var(--band-ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--band-ink); border-bottom-color: var(--gold); text-decoration: none; }
.site-header a:focus-visible { outline-color: var(--gold); }

/* Home page */
.hero {
  padding: 3.5rem 0; margin-bottom: 2.5rem;
  background: var(--band); color: var(--band-ink); border-bottom: 4px solid var(--gold);
}
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.4rem); font-weight: 400; line-height: 1.05;
  letter-spacing: -0.015em; margin: 0 0 1.5rem; font-variation-settings: "opsz" 72;
}
.hero h1::after { content: ""; display: block; width: 4rem; height: 3px; background: var(--gold); margin-top: 1.25rem; }
.tagline { font-size: 1.3rem; line-height: 1.55; margin: 0; max-width: 34rem; color: var(--band-muted); }
.intro { padding-bottom: 1rem; }
.intro p { margin: 0 0 1.2rem; }
.parts { list-style: none; margin: 1.5rem 0 2.5rem; padding: 0; counter-reset: part; }
.parts li {
  counter-increment: part; display: grid; grid-template-columns: 3rem 1fr; column-gap: 0.75rem;
  padding: 1.3rem 1.25rem; margin-bottom: 0.75rem;
  border-left: 5px solid var(--c); background: var(--c-soft); border-radius: 0 4px 4px 0;
}
.parts li:nth-child(1) { --c: var(--part1); --c-soft: var(--part1-soft); }
.parts li:nth-child(2) { --c: var(--part2); --c-soft: var(--part2-soft); }
.parts li:nth-child(3) { --c: var(--part3); --c-soft: var(--part3-soft); }
.parts li:nth-child(4) { --c: var(--part4); --c-soft: var(--part4-soft); }
.parts li::before { content: counter(part); font-size: 2.2rem; line-height: 1; color: var(--c); font-variation-settings: "opsz" 72; }
.parts h2 { font-size: 1.35rem; font-weight: 600; margin: 0 0 0.35rem; line-height: 1.3; }
.parts h2 a { color: var(--c); text-decoration: none; }
.parts h2 a:hover { text-decoration: underline; }
.parts p { margin: 0; color: var(--muted); }
.start {
  display: inline-block; margin: 0.5rem 0 4.5rem; padding: 0.7rem 1.4rem; border-radius: 3px;
  background: var(--accent); color: var(--paper); text-decoration: none; font-weight: 600;
}
.start:hover { filter: brightness(1.08); }

/* Reading pages */
.reading { padding: 2.5rem 0 3rem; }
.reading h1 {
  font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 400; line-height: 1.15;
  margin: 0.5rem 0 1.5rem; font-variation-settings: "opsz" 60;
}
.reading h1::after { content: ""; display: block; width: 3rem; height: 3px; background: var(--gold); margin-top: 1rem; }
.reading h2 { font-size: 1.4rem; font-weight: 600; line-height: 1.3; margin: 2.5rem 0 0.75rem; }
.reading article p { margin: 0 0 1.15rem; hyphens: auto; }
.context {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem;
  font-size: 0.95rem; color: var(--muted); margin: 0 0 1rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule);
}
.revised { font-size: 0.9rem; color: var(--muted); margin: 2.5rem 0 1.5rem; }
.prevnext { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; }
.prevnext a { display: block; max-width: 48%; text-decoration: none; line-height: 1.4; }
.prevnext a[rel="next"] { text-align: right; margin-left: auto; }
.prevnext a span { display: block; font-size: 0.85rem; color: var(--muted); }
.prevnext a:hover { text-decoration: underline; }
.eyebrow { font-size: 0.95rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); margin: 1.25rem 0 0; }
.overview h1 { margin-top: 0.25rem; }
.overview .overview-head { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 1.75rem 0 0.6rem; }
.overview .context { justify-content: space-between; }
.summary { font-size: 1.2rem; line-height: 1.6; margin: 0 0 2rem; }
.section-list { margin: 0 0 2rem; padding-left: 1.5rem; }
.section-list li { margin-bottom: 0.5rem; }
.contents { list-style: none; padding: 0; margin: 2rem 0 1rem; }
.contents > li > h2 { margin: 0 0 0.75rem; }
.contents > li > h2 a { color: var(--ink); text-decoration: none; }
.contents > li > h2 a:hover { text-decoration: underline; }
.note {
  background: var(--accent-soft); border-left: 5px solid var(--accent);
  padding: 1rem 1.25rem; border-radius: 0 4px 4px 0; margin: 0 0 2rem;
}
.note h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.note p { margin: 0; }
.pending { color: var(--muted); font-style: italic; }

/* Text elements inside reading pages */
.reading blockquote {
  margin: 1.4rem 0; padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 3px solid var(--gold); color: var(--ink);
}
.reading blockquote p { margin: 0 0 0.6rem; font-size: 1.05rem; line-height: 1.65; }
.reading blockquote p:last-child { margin-bottom: 0; }
.reading article ul, .reading article ol { margin: 0 0 1.15rem; padding-left: 1.5rem; }
.reading article li { margin-bottom: 0.3rem; }
.table-wrap { overflow-x: auto; margin: 1.4rem 0 1.6rem; }
.reading table { border-collapse: collapse; font-size: 0.95rem; line-height: 1.45; min-width: 100%; }
.reading th, .reading td { text-align: left; vertical-align: top; padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--rule); }
.reading th { font-weight: 600; border-bottom: 2px solid var(--gold); white-space: nowrap; }
.reading tbody tr:nth-child(even) { background: var(--accent-soft); }
sup { line-height: 0; }
.footnote-ref { text-decoration: none; font-size: 0.8em; padding: 0 0.15em; font-weight: 600; }
.footnote { margin-top: 2.5rem; font-size: 0.95rem; color: var(--ink); }
.footnote hr { border: 0; border-top: 1px solid var(--rule); width: 6rem; margin: 0 0 1rem; }
.footnote ol { padding-left: 1.5rem; }
.footnote li p { margin: 0 0 0.75rem; }
.footnote blockquote p { font-size: 0.95rem; }
.footnote-backref { text-decoration: none; padding-left: 0.25rem; }
:target { scroll-margin-top: 1rem; }
.reading .footnote li:target { background: var(--accent-soft); }

/* Contents page */
.chapters { list-style: none; margin: 0; padding: 0; }
.chapter { display: grid; grid-template-columns: 2.25rem 1fr; column-gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }
.chapter .num { color: var(--gc, var(--muted)); font-weight: 600; text-align: right; padding-right: 0.25rem; }
.ch-title { font-weight: 600; text-decoration: none; }
a.ch-title { color: var(--ink); }
a.ch-title:hover { text-decoration: underline; }
.ch-title.unpublished { color: var(--muted); font-weight: 400; }
.group { margin: 2.25rem 0 0; border-left: 5px solid var(--gc); padding-left: 1rem; }
.group h2 { color: var(--gc); font-size: 1.3rem; margin: 0 0 0.5rem; }
.g1 { --gc: var(--part1); } .g2 { --gc: var(--part2); } .g3 { --gc: var(--part3); }
.g4 { --gc: var(--part4); } .g0 { --gc: var(--rule); }
details summary { cursor: pointer; font-size: 0.9rem; color: var(--accent); list-style: none; margin-top: 0.15rem; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; }
details[open] summary::before { content: "\2212  "; }
details .hide, details[open] .show { display: none; }
details[open] .hide { display: inline; }
details .section-list { margin: 0.5rem 0 0.4rem; font-size: 1rem; }
.context-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* Footer */
.site-footer { background: var(--band); border-top: 4px solid var(--gold); color: var(--band-muted); font-size: 0.95rem; }
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }
.site-footer a { color: var(--band-muted); text-decoration: none; }
.site-footer a:hover { color: var(--band-ink); text-decoration: underline; }

@media (max-width: 30rem) {
  body { font-size: 1.0625rem; }
  .parts li { grid-template-columns: 2.25rem 1fr; }
  .prevnext a { max-width: 50%; }
}
@media print {
  .site-header, .site-footer, .prevnext { display: none; }
  body { background: #fff; color: #000; }
}

/* Appendix roadmap tables */
.reading h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.6rem; }
.roadmap td:first-child, .roadmap td:nth-child(2) { white-space: nowrap; }
.roadmap td:last-child, .roadmap th:last-child { text-align: center; }
.reading .roadmap tbody tr:nth-child(even) { background: none; }
.reading .roadmap tr.rm-part th {
  background: var(--accent-soft); color: var(--accent); font-size: 1rem; white-space: normal;
  border-bottom: 2px solid var(--gold); padding-top: 0.7rem;
}
.reading .roadmap tr.rm-sub td { font-style: italic; color: var(--muted); padding-top: 0.6rem; border-bottom: 1px solid var(--rule); }
.reading .roadmap tr.rm-sub td em { font-style: normal; }
.rm-ref { font-size: 0.85em; font-weight: 600; text-decoration: none; font-style: normal; }
.rm-note { display: inline-block; min-width: 1.4em; font-weight: 700; color: var(--accent); }
.reading p:has(.rm-note:target) { background: var(--accent-soft); }
