:root {
  color-scheme: light;
  --paper: #f8f5f0;
  --ink: #332f2b;
  --muted: #776f65;
  --rule: #d9d1c6;
  --accent: #8d493e;
  background: var(--paper);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; border-radius: 0; padding: 8px 4px; }
button:hover, a:hover { color: var(--accent); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 1px solid var(--muted); outline-offset: 5px; }
button:disabled { opacity: .2; cursor: default; color: var(--muted); }
[hidden] { display: none !important; }
.edition { width: min(660px, 100%); margin: 0 auto; padding: clamp(12px, 3svh, 32px) 40px; }
.masthead { margin-bottom: clamp(12px, 2.5svh, 24px); }
.collection { margin: 0 0 clamp(6px, 1svh, 12px); color: var(--muted); font-size: 12px; line-height: 1.5; }
h1 { margin: 0; font-size: clamp(25px, 3.6svh, 34px); font-weight: 400; line-height: 1.2; letter-spacing: -.025em; }
.byline { margin: clamp(7px, 1.2svh, 13px) 0 0; font-style: italic; color: var(--muted); font-size: 14px; }
.poem { font-size: clamp(16px, calc((100svh - 300px) / 21.5), 20px); line-height: 1.4; }
.stanza { margin: 0 0 clamp(8px, 1.8svh, 20px); }
.stanza:last-child { margin-bottom: 0; }
.verse { margin: 0; }
.verse-button { display: block; width: 100%; padding: 0 0 0 1em; text-indent: -1em; text-align: left; font: inherit; line-height: inherit; color: var(--ink); touch-action: manipulation; transition: color 180ms ease; }
.verse-button:hover { color: var(--ink); }
.verse-button.is-paired { color: var(--accent); }
.verse-button:focus-visible { outline: none; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 5px; text-decoration-thickness: 1px; }
.letter { transition: color 150ms ease; }
.letter.is-lit { color: #a3332c; }
.folio { display: flex; align-items: center; justify-content: space-between; margin: clamp(8px, 1.7svh, 18px) 0 0; }
.folio button { font-size: 24px; min-width: 36px; min-height: 38px; }
.folio #number { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .035em; }
.reading-invitation { text-align: left; margin: clamp(6px, 1.3svh, 12px) 0 3px; font-size: 12px; font-style: italic; color: var(--muted); line-height: 1.6; }
.reading-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 23px; color: var(--muted); font-size: 12px; }
.reading-tools button { min-height: 40px; }
#animation { min-width: 137px; }
#animation[aria-pressed="true"] { color: var(--accent); }
.goto-panel { margin: 22px auto 0; max-width: 420px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px 14px; align-items: baseline; font-size: 14px; }
.goto-panel input { width: 100%; min-width: 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none; padding: 7px; }
.hint { font-size: 12px; line-height: 1.65; color: var(--muted); }
.goto-panel .hint, .goto-panel .error { grid-column: 2 / -1; margin: 0; }
.error { color: #a3332c; font-size: 13px; }
.about-panel { border-top: 1px solid var(--rule); margin: 25px 0 0; padding-top: 23px; font-size: 15px; line-height: 1.75; }
.about-panel p { margin: 0 0 15px; }
.landmarks { display: flex; gap: 28px; margin-bottom: 15px; font-style: italic; }
.about-panel a { font-size: 13px; color: var(--muted); text-decoration-color: var(--rule); text-underline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; border: 0; }
@media (max-width: 560px) {
  .edition { padding-inline: 20px; }
  .poem { font-size: 16px; }
  .reading-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
}
@media (max-width: 350px) {
  .edition { padding-inline: 14px; }
  .poem { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .verse-button, .letter { transition: none; }
}

/* Embedded reader: the parent page supplies title and contextual notes. */
[data-embedded="true"] .masthead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
[data-embedded="true"] .edition{padding:12px 22px}
[data-embedded="true"] .poem{font-size:clamp(16px,calc((100svh - 195px)/21.5),20px)}
