:root {
  color-scheme: dark;
  color: #fff5df;
  background: #180f24;
  font-family: system-ui, sans-serif;
  --gold: #f0ce8b;
  --green: #b7ebc8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 75% 4%, #302049, transparent 36rem), #180f24;
}
.masthead, main { width: min(72rem, calc(100% - 3rem)); margin-inline: auto; }
.masthead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 1.15rem 2rem;
  padding-block: 3.5rem 1.5rem;
}
h1, h2 { font-family: Georgia, serif; text-wrap: balance; }
h1 { margin: 0; font-size: clamp(2.35rem, 6vw, 4.65rem); line-height: 1.03; font-weight: 400; }
.eyebrow { color: var(--gold); margin: 0 0 .65rem; letter-spacing: .1em; font-size: .79rem; text-transform: uppercase; }
button, .chapter-actions a { font: inherit; }
button, a { touch-action: manipulation; }
button {
  background: #214736;
  color: #edfff5;
  border: 1px solid #6caa89;
  border-radius: 2rem;
  padding: .7rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
}
#music-status { margin: .55rem 0 0; max-width: 20rem; color: var(--gold); }
#soundtrack-title { margin: 0 0 .45rem; color: var(--gold); }
.masthead .eyebrow { margin: .7rem 0 0; }
#calendar {
  padding: 1rem 0;
  margin: 0 0 1.35rem;
  border-block: 1px solid #64546b;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: .45rem;
  list-style: none;
}
#calendar a, #calendar span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: .55rem;
  text-decoration: none;
}
#calendar a { color: var(--green); border: 1px solid #658673; background: #25362e; }
#calendar a[aria-current] { color: #171224; background: var(--gold); border-color: var(--gold); font-weight: 700; }
#calendar span { color: #c6b8cd; background: #2b2137; }
a:focus-visible, button:focus-visible { outline: 2px solid #fff5df; outline-offset: 3px; }
article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-radius: 1rem;
  background: #fff5df;
  color: #241a2c;
  align-items: start;
  overflow: hidden;
  margin-bottom: 3rem;
}
figure { margin: 0; background: #221732; }
figure img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.reading { padding: clamp(1.3rem, 3.8vw, 3rem); }
.reading .eyebrow { color: #52664d; font-weight: 700; }
h2 { font-size: clamp(1.85rem, 4vw, 3rem); margin: 0 0 1rem; line-height: 1.12; }
#story { font: clamp(1.1rem, 2vw, 1.22rem)/1.62 Georgia, serif; }
#story p { margin: 0 0 1em; white-space: pre-line; }
.chapter-actions {
  display: flex;
  justify-content: space-between;
  gap: .5rem 1rem;
  flex-wrap: wrap;
  border-top: 1px solid #c7b9aa;
  margin-top: 1.35rem;
  padding-top: .65rem;
}
.chapter-nav { display: flex; gap: .8rem; }
.chapter-actions a { color: #2b5843; padding-block: .6rem; text-underline-offset: .23em; }
.chapter-actions a:focus-visible { outline-color: #2b5843; }
#message:empty { display: none; }
@media (max-width: 740px) {
  .masthead, main { width: calc(100% - 2rem); }
  .masthead { padding-top: 2rem; }
  article { grid-template-columns: 1fr; }
  #calendar { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .32rem; }
}
@media (max-width: 365px) { #calendar { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
