:root {
  --cream: #f8f0df;
  --cream-deep: #efe1c8;
  --paper: #fffaf0;
  --sage: #7d8f72;
  --sage-dark: #314638;
  --moss: #526748;
  --bark: #514036;
  --clay: #c67152;
  --gold: #d4a446;
  --mist: #dfe7d8;
  --line: rgba(81, 64, 54, 0.16);
  --shadow: 0 18px 46px rgba(67, 54, 43, 0.12);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Trebuchet MS", "Avenir Next", Avenir, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--bark);
  background: var(--cream);
  font-family: var(--sans);
  line-height: 1.6;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-shell { overflow: hidden; }
.skip-link {
  position: fixed;
  z-index: 20;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 0.9rem;
  color: var(--paper);
  background: var(--sage-dark);
  border-radius: 0.35rem;
  transition: top 160ms ease;
}
.skip-link:focus { top: 1rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.1rem 0;
}
.wordmark {
  text-decoration: none;
  color: var(--sage-dark);
  font-family: var(--serif);
  font-size: clamp(1.18rem, 2.2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.wordmark small {
  display: block;
  margin-top: -0.1rem;
  color: var(--clay);
  font-family: var(--sans);
  font-size: 0.54em;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.primary-nav { display: flex; gap: 0.85rem; align-items: center; }
.primary-nav a {
  padding: 0.45rem 0.65rem;
  color: var(--sage-dark);
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}
.primary-nav a:hover, .primary-nav a:focus-visible { background: var(--mist); }

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(3.5rem, 9vw, 7.5rem) 1rem clamp(3rem, 8vw, 6rem);
  background:
    radial-gradient(circle at 12% 7%, rgba(212, 164, 70, 0.2) 0 7px, transparent 8px),
    radial-gradient(circle at 83% 20%, rgba(125, 143, 114, 0.22) 0 14px, transparent 15px),
    linear-gradient(135deg, #f8f0df 0%, #f4ead7 55%, #e4eadc 100%);
}
.hero::before, .hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 50% 50% 45% 55%;
  opacity: 0.75;
}
.hero::before { width: 35rem; height: 14rem; right: -12rem; bottom: -8rem; background: var(--mist); transform: rotate(-12deg); }
.hero::after { width: 25rem; height: 12rem; left: -13rem; top: -7rem; background: rgba(212, 164, 70, 0.12); transform: rotate(22deg); }
.hero-inner { width: min(1060px, 100%); margin: 0 auto; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--clay);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow::before { width: 1.65rem; height: 1px; background: currentColor; content: ""; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; }
h1 { max-width: 10ch; margin: 0; color: var(--sage-dark); font-size: clamp(3rem, 7.4vw, 6.7rem); letter-spacing: -0.075em; }
.hero-copy { max-width: 40rem; margin: 1.4rem 0 0; font-size: clamp(1.06rem, 2vw, 1.27rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.72rem 1.12rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--paper); background: var(--sage-dark); }
.button-primary:hover, .button-primary:focus-visible { background: var(--moss); }
.button-secondary { border-color: var(--sage); color: var(--sage-dark); background: rgba(255, 250, 240, 0.55); }
.button-secondary:hover, .button-secondary:focus-visible { background: var(--paper); }

.section { width: min(1060px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3.8rem, 8vw, 6.5rem) 0; }
.section-kicker { margin: 0 0 0.7rem; color: var(--clay); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.section h2 { max-width: 18ch; margin: 0; color: var(--sage-dark); font-size: clamp(2rem, 4.4vw, 3.7rem); letter-spacing: -0.055em; }
.section-intro { max-width: 42rem; margin: 1.15rem 0 0; font-size: 1.04rem; }

.world { background: var(--paper); }
.character-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2.2rem 0 0; padding: 0; list-style: none; }
.character-list li { min-height: 9rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--cream); box-shadow: 0 6px 18px rgba(81, 64, 54, 0.04); }
.character-list span { display: block; margin-bottom: 0.5rem; color: var(--clay); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.character-list strong { color: var(--sage-dark); font-family: var(--serif); font-size: 1.45rem; }
.character-list p { margin: 0.38rem 0 0; font-size: 0.91rem; line-height: 1.4; }
.character-gallery { display: grid; grid-template-columns: 1.14fr 0.86fr 0.86fr; gap: 1rem; margin-top: 2.2rem; }
.artwork-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; background: var(--cream); box-shadow: 0 8px 22px rgba(81, 64, 54, 0.06); }
.artwork-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--mist); }
.artwork-card figcaption { padding: 0.85rem 1rem 1rem; }
.artwork-card figcaption span { display: block; color: var(--clay); font-size: 0.71rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.artwork-card figcaption strong { display: block; margin-top: 0.15rem; color: var(--sage-dark); font-family: var(--serif); font-size: 1.26rem; line-height: 1.1; }
.artwork-card figcaption p { margin: 0.35rem 0 0; font-size: 0.84rem; line-height: 1.4; }

.book-feature { background: #e1e9db; }
.book-layout { display: grid; grid-template-columns: minmax(210px, 0.68fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 7vw, 6rem); }
.cover-shell {
  position: relative;
  display: grid;
  aspect-ratio: 1075 / 1103;
  min-height: 0;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(49, 70, 56, 0.18);
  border-radius: 0.65rem 1.05rem 1.05rem 0.65rem;
  color: var(--sage-dark);
  background: var(--paper);
  box-shadow: -11px 13px 0 rgba(49, 70, 56, 0.10), var(--shadow);
}
.cover-shell::after { position: absolute; top: 0; bottom: 0; left: 0; width: 0.45rem; content: ""; background: var(--cream-deep); }
.cover-shell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--cream-deep); opacity: 0; transition: opacity 250ms ease; }
.cover-shell.has-authentic-cover img { opacity: 1; }
.cover-fallback { width: min(86%, 16rem); text-align: center; }
.cover-fallback span { display: block; color: var(--clay); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.cover-fallback strong { display: block; margin: 0.7rem 0; font-family: var(--serif); font-size: 1.7rem; line-height: 1; }
.cover-fallback em { display: block; color: var(--sage); font-size: 0.78rem; font-style: normal; }
.has-authentic-cover .cover-fallback { visibility: hidden; }
.book-copy h2 { max-width: 15ch; }
.book-copy p { max-width: 40rem; }
.book-byline { margin: 1rem 0 0; color: var(--sage); font-size: 0.86rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.future-books { text-align: center; }
.future-books h2 { margin-right: auto; margin-left: auto; }
.future-card { max-width: 32rem; margin: 2rem auto 0; padding: 2.1rem; border: 1px dashed rgba(81, 64, 54, 0.32); border-radius: 1rem; color: var(--sage-dark); background: rgba(255, 250, 240, 0.56); }
.future-card p { margin: 0.5rem 0 0; }
.future-card .sprout { display: inline-block; color: var(--clay); font-family: var(--serif); font-size: 2.5rem; line-height: 1; }

.story-hero { padding: clamp(2.7rem, 6vw, 5rem) 1rem 3rem; background: linear-gradient(135deg, #e6ecdf 0%, #f8f0df 58%, #f3e5cc 100%); }
.story-hero-inner { display: grid; grid-template-columns: minmax(170px, 0.58fr) minmax(0, 1.25fr); align-items: center; gap: clamp(1.7rem, 6vw, 5rem); width: min(940px, 100%); margin: 0 auto; }
.story-cover { max-width: 18rem; }
.story-hero h1 { max-width: 12ch; font-size: clamp(2.55rem, 6vw, 5.25rem); }
.story-hero p { max-width: 35rem; margin: 1rem 0 0; font-size: clamp(1.04rem, 2vw, 1.2rem); }

.listen-section { max-width: 760px; }
.listen-section h2 { max-width: none; }
.audio-player { margin-top: 2rem; padding: clamp(1.1rem, 3vw, 1.8rem); border: 1px solid rgba(49, 70, 56, 0.18); border-radius: 1.2rem; background: var(--paper); box-shadow: var(--shadow); }
.audio-player audio { display: none; }
.player-topline { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.player-label { margin: 0; color: var(--sage-dark); font-family: var(--serif); font-size: 1.27rem; font-weight: 700; }
.player-status { max-width: 24rem; margin: 0.3rem 0 0; color: #5f5b52; font-size: 0.88rem; }
.player-controls { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 0.8rem; margin-top: 1.25rem; }
.player-button { min-width: 5.3rem; min-height: 3rem; padding: 0.65rem 0.85rem; border: 0; border-radius: 0.75rem; font-weight: 800; }
.play-button { color: var(--paper); background: var(--sage-dark); }
.replay-button { color: var(--sage-dark); border: 1px solid var(--sage); background: transparent; }
.player-button:disabled { opacity: 0.42; cursor: not-allowed; }
.player-button:not(:disabled):hover, .player-button:not(:disabled):focus-visible { filter: brightness(1.06); transform: translateY(-1px); }
.progress-wrap { display: grid; gap: 0.42rem; }
.progress-times { display: flex; justify-content: space-between; color: #5f5b52; font-size: 0.79rem; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--clay); }
.player-turn-note { margin: 1.35rem 0 0; padding: 0.9rem 1rem; border-left: 3px solid var(--gold); color: var(--sage-dark); background: #fff5dc; }
.player-turn-note strong { font-family: var(--serif); }
.is-unavailable .player-controls { opacity: 0.62; }
.is-unavailable .player-button, .is-unavailable input { pointer-events: none; }

.site-footer { padding: 2rem 1rem; color: #e8ecdf; background: var(--sage-dark); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(1060px, 100%); margin: 0 auto; }
.footer-inner p { margin: 0; font-size: 0.85rem; }
.footer-inner a { color: var(--cream); }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (max-width: 760px) {
  .character-list { grid-template-columns: repeat(2, 1fr); }
  .character-gallery { grid-template-columns: 1fr 1fr; }
  .artwork-card:first-child { grid-column: 1 / -1; }
  .book-layout, .story-hero-inner { grid-template-columns: 1fr; }
  .cover-shell { max-width: 17rem; }
  .book-layout .cover-shell, .story-hero .cover-shell { margin: 0 auto; }
  .player-controls { grid-template-columns: 1fr 1fr; }
  .progress-wrap { grid-column: 1 / -1; }
}
@media (max-width: 450px) {
  .site-header { align-items: flex-start; }
  .primary-nav { flex-direction: column; align-items: flex-end; gap: 0.2rem; }
  .character-list { grid-template-columns: 1fr; }
  .character-gallery { grid-template-columns: 1fr; }
  .artwork-card:first-child { grid-column: auto; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }
