/* Eight text styles at most: body, body bold, small, lead, heading 2, heading 1, quotes, and italic titles. */
:root {
  --bg: #faf5ec;
  --paper: #fffdf8;
  --ink: #26211c;
  --muted: #675d53;
  --line: #e6dac8;
  --accent: #9c3f17;
  --accent-soft: #f5e3d3;
  --quote: #f3ebdd;
  --green: #276457;
  --green-soft: #e1efe9;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181613;
    --paper: #221f1b;
    --ink: #f1e9dd;
    --muted: #b6ab9d;
    --line: #3b352e;
    --accent: #f2a77f;
    --accent-soft: #3a2a20;
    --quote: #2b2722;
    --green: #86d4c0;
    --green-soft: #1e302b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.kids { font-size: 1.125rem; }

main, .top, footer {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1rem;
}

main { padding-bottom: 3rem; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; text-wrap: balance; font-weight: 700; }
h1 { font-size: 2.1em; margin: 1.25rem 0 0.75rem; }
h2 { font-size: 1.3em; margin: 2.25rem 0 0.5rem; }
h3 { font-size: 1em; margin: 1.5rem 0 0.4rem; }
p { margin: 0 0 0.9rem; }

.small, .meta, .crumbs, .change, .label, .site, footer, .top nav a, blockquote .who {
  font-size: 0.875em;
  font-weight: 400;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.top .home { color: var(--ink); font-weight: 700; text-decoration: none; }
.top nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.top nav a {
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-soft);
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.lead { font-size: 1.3em; line-height: 1.4; color: var(--muted); }
.say { font-size: 1.3em; font-weight: 700; }
.meta, .small { color: var(--muted); }
.small { margin-top: 2rem; }
.crumbs { margin: 1.25rem 0 0; }

.doors { display: grid; gap: 1rem; margin: 2rem 0 1rem; }
.door, .start {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.door strong { display: block; color: var(--accent); font-size: 1.3em; line-height: 1.2; margin-bottom: 0.35rem; }
.start {
  margin: 1.5rem 0;
  font-weight: 700;
  color: var(--green);
  background: var(--green-soft);
  border-color: transparent;
}
.start::after { content: " →"; }

/* On a phone a card is a section under a rule, so its text keeps the full width. */
.card {
  border-top: 1px solid var(--line);
  padding: 0.25rem 0 0.5rem;
  margin: 2rem 0;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 1rem; }

.three { margin: 0; display: grid; gap: 0.75rem; }
.three dt { font-weight: 700; color: var(--green); }
.three dd { margin: 0; }
.three dd p:last-child { margin-bottom: 0; }

blockquote {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--quote);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-family: var(--serif);
}
blockquote p { margin: 0 0 0.4rem; }
blockquote p:last-child { margin-bottom: 0; }
blockquote .who {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--accent);
  margin-right: 0.35rem;
}
blockquote p.who { display: block; margin-bottom: 0.2rem; }
blockquote.source { background: transparent; border: 1px solid var(--line); border-left-width: 4px; }

del { color: var(--muted); text-decoration-thickness: 1px; }
.changed { text-decoration: underline dotted; text-underline-offset: 0.2em; }
.change { color: var(--muted); }
.words { color: var(--muted); }
.words b { color: var(--ink); }

.label { margin: 1rem 0 0.35rem; color: var(--muted); }
.passage + .passage { border-top: 1px dashed var(--line); margin-top: 1rem; }

.cite { margin-bottom: 0.25rem; }
.details { color: var(--muted); }

ul.links, ul.reads, ul.episodes, ul.facts { list-style: none; padding: 0; margin: 0 0 0.75rem; }
ul.links li { margin: 0.25rem 0; }
ul.links a { display: inline-block; padding: 0.3rem 0; }

ul.reads li { margin: 0 0 1rem; }
.read {
  display: block;
  padding: 0.75rem 1rem;
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.read .name::after { content: " →"; }
.read .site { display: block; color: var(--muted); }

.ask {
  background: var(--green-soft);
  border-radius: 12px;
  padding: 0.25rem 0.75rem 0.5rem;
  margin-top: 1rem;
}
.ask h3 { color: var(--green); margin-top: 0.9rem; }
.ask ol { padding-left: 1.1rem; margin: 0 0 0.5rem; }
.ask li { margin-bottom: 0.6rem; }

ul.episodes li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
}
ul.episodes a { font-weight: 700; }
ul.episodes .meta { display: block; margin-top: 0.15rem; }

ul.facts li.fact { border-top: 1px solid var(--line); padding: 0.25rem 0 0.75rem; }
ul.facts .cite { margin-top: 0.75rem; }
details summary { cursor: pointer; color: var(--accent); padding: 0.25rem 0; }
ul.extracts { padding-left: 1.1rem; font-family: var(--serif); }
ul.extracts li { margin: 0.4rem 0; }

ol.questions { list-style: none; padding: 0; margin: 0; counter-reset: q; }
ol.questions li {
  counter-increment: q;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.25rem 1rem 0.5rem;
  margin: 1rem 0;
}
ol.questions h2 { margin-top: 0.9rem; color: var(--green); }
ol.questions h2::before { content: counter(q) ". "; }
.eg { background: var(--quote); border-radius: 10px; padding: 0.6rem 0.8rem; }

.method dt { font-weight: 700; margin-top: 1rem; }
.method dd { margin: 0.2rem 0 0; }

.people { margin: 0 0 1.25rem; }
.people dt { font-weight: 700; color: var(--accent); margin-top: 1.25rem; }
.people dd { margin: 0.2rem 0 0; }

@media (min-width: 40rem) {
  body.kids { font-size: 1.1875rem; }
  h1 { font-size: 2.4em; }
  .doors { grid-template-columns: 1fr 1fr; }
  .card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.5rem 1.5rem 1.25rem;
    margin: 1.5rem 0;
  }
  .ask { padding: 0.25rem 1rem 0.5rem; }
}
