:root {
  color-scheme: light;
  --paper: #f7f2e9;
  --ink: #29191b;
  --wine: #542c37;
  --gold: #aa824c;
  --serif: "Iowan Old Style", Baskerville, "Times New Roman", serif;
  --sans: system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font: 100% var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, figure, p { margin: 0; }
[hidden] { display: none !important; }
a, button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

.edition {
  width: min(100% - 8vw, 1440px);
  min-height: 100svh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.masthead, .colophon { color: #685345; }
.masthead {
  min-height: 81px;
  border-bottom: 1px solid #d8c7ae;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brand {
  font: 600 1.73rem/1 var(--serif);
  letter-spacing: -.025em;
  text-transform: none;
  text-decoration: none;
}
.masthead .brand { color: var(--wine); }

.cover {
  display: grid;
  grid-template-columns: minmax(0, .77fr) minmax(0, 1.23fr);
  align-items: center;
  gap: clamp(2rem, 5.1vw, 6.2rem);
  padding-block: clamp(2.75rem, 7vw, 7.5rem);
}

.byline {
  color: #694f3f;
  font-size: .79rem;
  font-weight: 650;
  letter-spacing: .19em;
  text-transform: uppercase;
  margin-block-end: 1.25rem;
}

h1 {
  color: var(--ink);
  font: 400 clamp(3.15rem, 6vw, 6.8rem)/.96 var(--serif);
  letter-spacing: -.066em;
}
h1 em { color: var(--wine); font-weight: 400; }

.ornament {
  width: 6.5rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-block: 1.65rem 1.2rem;
  color: var(--gold);
}
.ornament::before, .ornament::after {
  content: "";
  flex: 1;
  border-top: 1px solid currentColor;
}
.ornament i { width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); }

.intro {
  color: #5b4941;
  font: 400 clamp(1.14rem, 1.65vw, 1.36rem)/1.48 var(--serif);
  max-width: 28ch;
}

.enter {
  display: inline-flex;
  align-items: center;
  gap: .67rem;
  padding: .95rem 1.32rem;
  margin-block-start: 1.75rem;
  border-radius: 3rem;
  background: var(--wine);
  color: #fff8eb;
  font-size: .93rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color .18s;
}
.enter:hover { background: #70394a; }
.enter svg { width: 19px; height: 19px; }
.edition-meta { margin-block-start: .9rem; font-size: .83rem; color: #685345; }
.edition-meta span { padding-inline: .28rem; }

.mat {
  background: #e9dcc6;
  border: 1px solid #c8a879;
  padding: clamp(.45rem, 1.15vw, 1.05rem);
  box-shadow: 0 16px 48px #3f28132b;
}
.mat img { display: block; width: 100%; height: auto; outline: 1px solid #876842; }
.cover-plate figcaption {
  color: #685345;
  font: italic 1rem/1.3 var(--serif);
  margin-block-start: .85rem;
  text-align: end;
}
.colophon {
  border-top: 1px solid #d8c7ae;
  padding-block: 1.25rem;
  font-size: .82rem;
}
.fallback { padding: 1rem 4vw; }
.fallback audio { display: block; max-width: 100%; margin-block-start: .6rem; }

.reader {
  color-scheme: dark;
  background: #181315;
  color: #f2e6d4;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.reader-header {
  min-height: 67px;
  padding: .5rem max(4vw, 1rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #473633;
}
.reader-header h2 { font: 400 clamp(1.25rem, 3vw, 1.65rem)/1.05 var(--serif); text-align: center; }
.reader-brand { justify-self: end; color: #c4a374; font-size: 1.2rem; }
.exit {
  justify-self: start;
  padding: .65rem .85rem;
  border: 1px solid #6d5650;
  border-radius: 2rem;
  text-decoration: none;
  color: #e1c8a7;
  font-size: .82rem;
}
.exit:hover, .step:hover:not(:disabled) { background: #39282d; }

.reading {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: .8rem;
  padding: clamp(1rem, 3vh, 2.2rem) 1rem;
}
.story-plate {
  width: min(100%, 1120px, max(390px, calc((100svh - 290px) * 1.5)));
}
.canvas {
  background: #211a1b;
  outline: 1px solid #67503b;
  box-shadow: 0 14px 46px #08060699;
  touch-action: pan-y pinch-zoom;
  aspect-ratio: 3 / 2;
}
.canvas img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.plate-note {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-block-start: .7rem;
  min-height: 2.5rem;
  color: #dcc6ac;
  font: italic 1.07rem/1.2 var(--serif);
}
#count, .timeline { font: .79rem/1 var(--sans); font-variant-numeric: tabular-nums; color: #c9af93; }
#count { white-space: nowrap; letter-spacing: .08em; }
.deck { width: min(100%, 640px); }
.transport { display: flex; align-items: center; justify-content: center; gap: clamp(1.25rem, 6vw, 2.65rem); }
.transport button {
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
}
.transport svg { width: 22px; height: 22px; }
.step { width: 44px; height: 44px; border: 1px solid #725b4d; color: #e4c7a2; background: transparent; }
.step svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.step:disabled { opacity: .4; cursor: default; }
.play { width: 53px; height: 53px; border: 0; background: #e5c595; color: #271b20; }
.play:hover { background: #f7dbaf; }
.play svg { fill: currentColor; }
.play .pause-icon, .play.is-playing .play-icon { display: none; }
.play.is-playing .pause-icon { display: block; }
.timeline {
  display: grid;
  grid-template-columns: 3ch 1fr 4ch;
  align-items: center;
  gap: .9rem;
  margin-top: .3rem;
}
.timeline span:last-child { text-align: end; }
#position {
  --fill: 0%;
  appearance: none;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
#position::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #d4af7c var(--fill), #66504a var(--fill));
}
#position::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #d4af7c var(--fill), #66504a var(--fill));
}
#position::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #ecd0a6;
}
#position::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: #ecd0a6;
}
#notice { color: #f1cfab; text-align: center; font-size: .9rem; padding: .35rem; }

@media (max-width: 820px) {
  .edition { width: calc(100% - 2.5rem); }
  .masthead { min-height: 64px; }
  .cover { gap: 1.65rem; }
  .title-break { display: none; }
  .reader-brand { display: none; }
  .reader-header { grid-template-columns: 1fr 2fr 1fr; }
}

@media (max-width: 640px) {
  .cover { grid-template-columns: 1fr; align-content: start; padding-block: 2rem; }
  .cover-copy { text-align: center; }
  h1 { max-width: 11ch; margin-inline: auto; font-size: clamp(3rem, 10vw, 4.25rem); }
  .byline { margin-block-end: .7rem; }
  .ornament { margin: 1rem auto .7rem; }
  .intro { margin-inline: auto; max-width: 32ch; }
  .enter { margin-block-start: 1.25rem; }
  .cover-plate figcaption { font-size: .9rem; }
}

@media (max-width: 420px) {
  .reader-header { grid-template-columns: auto 1fr; }
  .reader-header h2 { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
