:root {
  color-scheme: light;
  --paper: #f8f5ee;
  --panel: #fffdf8;
  --ink: #242823;
  --muted: #585d55;
  --line: #cbc6ba;
  --tom: #173e70;
  --kairo: #255c3b;
  --axiom: #653978;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--tom); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tom); outline-offset: 4px; }
p { line-height: 1.6; }
h1, h2, h3 { font-weight: normal; line-height: 1.13; }
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); margin: .16em 0 .3em; overflow-wrap: anywhere; letter-spacing: -.045em; }
h2 { font-size: clamp(1.55rem, 3.6vw, 2.2rem); margin: 0 0 .8em; }
h3 { font-size: 1.25rem; margin: 1em 0; }
main { flex: 1; width: min(100% - 2.5rem, 72rem); margin: 0 auto; padding-block: clamp(2.5rem, 8vw, 6rem); }
.masthead, .site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem 1.5rem; flex-wrap: wrap;
  padding: 1.1rem max(1.25rem, calc((100vw - 72rem) / 2)); border-bottom: 1px solid var(--line);
}
.masthead nav { display: flex; gap: .65rem 1.2rem; flex-wrap: wrap; }
.masthead a, .site-footer a { display: inline-block; padding-block: .5rem; }
.brand { font-size: 1.35rem; text-decoration: none; color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); border-bottom: 0; color: var(--muted); }
.site-footer, nav, .eyebrow, .status, .hint, .queue small, .credits, .preview-bar, .byline {
  font-family: system-ui, sans-serif;
}
.eyebrow { color: var(--muted); font-size: .77rem; letter-spacing: .11em; font-weight: 650; }
.skip { position: absolute; left: 1rem; top: -8rem; background: var(--panel); padding: .75rem; }
.skip:focus { top: 1rem; z-index: 1; }
.intro { padding: 1rem 0 clamp(2.5rem, 7vw, 5rem); border-bottom: 1px solid var(--line); }
.deck { font-size: clamp(1.15rem, 2vw, 1.45rem); color: var(--muted); }
.contents, .credits { margin-top: 2.6rem; }
.credits { border-top: 1px solid var(--line); padding-top: 2rem; }
.credits h2 { font-family: Georgia, serif; font-size: 1.5rem; }
.credits dl { display: flex; flex-wrap: wrap; gap: 1rem 2rem; font-size: .9rem; }
.credits dd { margin: .35rem 0 0; color: var(--muted); }
.participant { font-weight: 700; }
.tom { color: var(--tom); }
.kairo { color: var(--kairo); }
.axiom { color: var(--axiom); }
.muted, .hint { color: var(--muted); }
.chapter-list { padding-left: 1.6rem; max-width: 44rem; }
.chapter-list li { border-bottom: 1px solid var(--line); padding: .7rem .3rem; }
.chapter-list a { display: inline-block; padding-block: .25rem; font-size: 1.2rem; }
.chapter-list span { margin-left: .3rem; }
.reading, .chapter-nav { max-width: 44rem; margin-inline: auto; }
.reading header { border-bottom: 1px solid var(--line); padding: 0 0 1.25rem; margin-bottom: 2rem; }
.reading h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); }
.prose { font-size: clamp(1.12rem, 2.2vw, 1.28rem); line-height: 1.7; overflow-wrap: anywhere; }
.prose p { line-height: inherit; }
.prose pre { overflow: auto; }
.prose blockquote { border-left: 2px solid var(--line); padding-left: 1.25rem; margin-inline: 0; color: var(--muted); }
.references, .chapter-nav { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.5rem; }
.references li { margin-bottom: .55rem; overflow-wrap: anywhere; }
.chapter-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: .65rem; align-items: end; font-size: .9rem; }
.chapter-nav div:last-child { text-align: right; }
.chapter-nav span { display: block; color: var(--muted); }
.chapter-nav a { display: inline-block; padding-block: .45rem; overflow-wrap: anywhere; }

.dashboard { max-width: 58rem; margin: auto; }
.dashboard h1, .signin h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.signin { max-width: 32rem; margin-inline: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); margin-top: 1.3rem; padding: clamp(1rem, 4vw, 2rem); }
summary { cursor: pointer; font-size: 1.25rem; }
.queue, .events { list-style: none; padding: 0; margin: 0; overflow-wrap: anywhere; }
.queue li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem; }
.queue li, .events li { border-top: 1px solid var(--line); padding: .9rem 0; }
.queue small { display: block; margin-top: .25rem; color: var(--muted); }
.status { font-size: .86rem; font-weight: 600; }
label { display: block; margin-top: 1rem; font-family: system-ui, sans-serif; font-weight: 600; }
input, textarea {
  display: block; width: 100%; margin-top: .4rem; border: 1px solid #85887f; border-radius: .15rem;
  color: var(--ink); background: white; padding: .6rem .7rem; font: 1rem system-ui, sans-serif;
}
textarea { resize: vertical; line-height: 1.5; }
.field-row { display: grid; grid-template-columns: 2fr 1fr; gap: .8rem; }
button, .button {
  display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--tom); border-radius: .15rem;
  padding: .55rem .8rem; background: var(--tom); color: white; font: 600 .9rem system-ui, sans-serif;
  text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { box-shadow: inset 0 0 0 1px currentColor; }
.secondary { color: var(--tom); background: var(--panel); }
form label + button, form .hint + button, .panel > form + form { margin-top: .8rem; }
.hint { font-size: .85rem; }
.preview-bar {
  max-width: 44rem; margin: 0 auto 2rem; padding: .85rem; display: flex; flex-wrap: wrap;
  align-items: center; gap: .7rem 1.2rem; border: 1px solid var(--line); background: var(--panel);
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .chapter-nav { font-size: .82rem; }
}
