:root {
  color-scheme: light;
  --paper: #fffdf8;
  --page-bg: #eee8dc;
  --ink: #201b16;
  --muted: #776d61;
  --line: #d7cebf;
  --accent: #e7bd4f;
  --accent-soft: #ffe58a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}
.site-shell {
  width: min(1040px, calc(100% - 28px));
  margin: 28px auto 64px;
  padding: 36px clamp(22px, 5vw, 64px) 60px;
  background: var(--paper);
  box-shadow: 0 10px 32px rgba(45, 35, 20, .10);
  border: 1px solid rgba(120, 100, 70, .16);
}
.breadcrumbs {
  margin: 0 0 28px;
  font-family: Arial, sans-serif;
  font-size: .88rem;
  color: var(--muted);
}
.breadcrumbs a { color: inherit; }
.kicker {
  text-transform: uppercase;
  letter-spacing: .16em;
  text-align: center;
  font: 700 .78rem/1.3 Arial, sans-serif;
  color: var(--muted);
}
h1, h2 { font-weight: 500; }
h1 {
  margin: .35em 0 .2em;
  text-align: center;
  font-size: clamp(2rem, 5vw, 3.5rem);
}
.subtitle {
  margin: 0 auto 2rem;
  max-width: 720px;
  text-align: center;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}
.card {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid var(--line);
  background: #fff;
}
a.button {
  display: inline-block;
  padding: .72rem 1rem;
  border: 1px solid #6e614f;
  color: #2a241d;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-weight: 700;
}
a.button:hover { background: #f4eee4; }

.reader-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -12px 28px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
}
.reader-toolbar audio {
  display: block;
  width: 100%;
}
.reader-status {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  min-height: 25px;
  margin-top: 8px;
  font: .82rem/1.2 Arial, sans-serif;
  color: var(--muted);
}
.reader-status strong { color: var(--ink); }
.reader-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.reader-controls button {
  padding: .4rem .65rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.reader-controls button:hover { background: #f3eee5; }

#readalong-text {
  max-width: 860px;
  margin: 0 auto;
  font-size: clamp(1.12rem, 2.2vw, 1.33rem);
  line-height: 1.95;
}
.read-block.body {
  margin: 1.05em 0 1.45em;
  text-indent: 1.35em;
}
.read-block.heading {
  margin: 1.7em auto .75em;
  text-align: center;
  text-indent: 0;
  font: 700 1.12em/1.5 Arial, sans-serif;
  letter-spacing: .035em;
}
.read-block.byline {
  margin: .2em auto 1.5em;
  text-align: center;
  text-indent: 0;
  font-style: italic;
}
.word {
  padding: .045em .065em;
  margin: 0 -.01em;
  border-radius: .15em;
  cursor: pointer;
  transition: background-color 80ms linear, box-shadow 80ms linear;
}
.word:hover {
  background: #eee8dc;
}
.word.active {
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.word:focus-visible {
  outline: 2px solid #5b4b32;
  outline-offset: 2px;
}
.loading, .error {
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
  font-family: Arial, sans-serif;
}
.error { color: #8a251d; }

@media (max-width: 640px) {
  .site-shell {
    width: 100%;
    margin: 0;
    padding: 24px 17px 48px;
    border: 0;
    box-shadow: none;
  }
  .reader-toolbar {
    margin-left: -5px;
    margin-right: -5px;
  }
  .reader-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
  #readalong-text {
    line-height: 1.85;
  }
}