/* ============================================================
   The Snarvels of Snarvelbarbleton
   Palette is lifted from the artwork itself: lantern gold, tunnel
   night-blue, Butterfluff's coat red, and parchment cream.
   ============================================================ */

:root {
  --night:    #14212c;
  --night-2:  #0c161e;
  --soil:     #2b1d13;
  --cream:    #f7edd8;
  --cream-2:  #ecdcbe;
  --ink:      #2a2018;
  --lantern:  #f2a93b;
  --lantern-2:#ffd27a;
  --ember:    #b8352b;
  --moss:     #6d8a53;

  --display: 'Fredoka', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --wrap: 1180px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* The top bar is fixed, so anchored sections must leave room for it or their
   headings land underneath it. */
section[id], main[id] { scroll-margin-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.13rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
}

img, picture { max-width: 100%; display: block; }

.wrap { width: min(var(--wrap), 92vw); margin-inline: auto; }
.narrow { max-width: 46rem; }
.center { text-align: center; }

.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip:focus {
  position: fixed; inset: .5rem auto auto .5rem; z-index: 200;
  background: var(--lantern); color: var(--soil); padding: .6rem 1rem;
  border-radius: 8px; font-weight: 700;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .01em;
  padding: .78em 1.5em;
  border: 2px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn-sm { font-size: .92rem; padding: .58em 1.15em; }

.btn-buy {
  background: var(--lantern);
  color: #43290a;
  box-shadow: 0 6px 0 #b9781f, 0 10px 22px rgba(0,0,0,.28);
}
.btn-buy:hover, .btn-buy:focus-visible {
  background: var(--lantern-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #b9781f, 0 14px 26px rgba(0,0,0,.32);
}
.btn-buy:active { transform: translateY(3px); box-shadow: 0 2px 0 #b9781f; }

.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: var(--cream);
}
.btn-ghost:hover, .btn-ghost:focus-visible { background: rgba(255,255,255,.12); }
.band-cream .btn-ghost, .band-buy .btn-ghost { color: var(--soil); }
.band-cream .btn-ghost:hover, .band-buy .btn-ghost:hover { background: rgba(0,0,0,.07); }

:focus-visible { outline: 3px solid var(--lantern-2); outline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; gap: 1.2rem;
  padding: .6rem clamp(.9rem, 3vw, 2rem);
  background: rgba(12,22,30,0);
  transition: background-color .3s ease, box-shadow .3s ease;
}
.topbar.is-stuck {
  background: rgba(12,22,30,.94);
  box-shadow: 0 2px 20px rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--display); font-weight: 600; font-size: 1.1rem;
  color: var(--cream); text-decoration: none; text-shadow: 0 2px 6px rgba(0,0,0,.6);
}
.brand-mark { font-size: 1.3rem; }
.topnav { display: flex; gap: 1.4rem; margin-left: auto; }
.topnav a {
  color: var(--cream); text-decoration: none; font-weight: 600; font-size: .95rem;
  text-shadow: 0 2px 6px rgba(0,0,0,.6); padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.topnav a:hover { border-bottom-color: var(--lantern); }

@media (max-width: 880px) {
  .topnav { display: none; }
  .topbar .btn-buy { margin-left: auto; }
}
/* The sticky bottom button covers small screens instead. */
@media (max-width: 560px) { .topbar .btn-buy { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--night-2);
}
.hero-art { position: absolute; inset: 0; }
.hero-art img {
  width: 100%; height: 100%; object-fit: cover;
  /* Keep the chipmunk and the town both in frame as the viewport narrows. */
  object-position: 62% 50%;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(8,14,20,.55) 0%, rgba(8,14,20,0) 28%),
    linear-gradient(to top, rgba(8,14,20,.92) 0%, rgba(8,14,20,.55) 34%, rgba(8,14,20,0) 62%);
}
.hero-inner {
  position: relative; z-index: 2;
  width: min(var(--wrap), 92vw); margin-inline: auto;
  padding: 0 0 clamp(5rem, 12vh, 9rem);
  color: var(--cream); text-align: center;
}
.eyebrow {
  font-family: var(--display); font-weight: 500;
  text-transform: uppercase; letter-spacing: .18em;
  font-size: clamp(.7rem, .62rem + .35vw, .85rem);
  color: var(--lantern-2); margin: 0 0 .7rem;
}
.eyebrow.dark { color: #a8702a; }

.hero-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.4rem, 1.1rem + 6.2vw, 5.6rem);
  line-height: .98; margin: 0;
  letter-spacing: -.01em;
  text-shadow: 0 3px 0 rgba(0,0,0,.35), 0 10px 34px rgba(0,0,0,.6);
}
.hero-title em { font-style: normal; color: var(--lantern-2); display: inline-block; }
.hero-sub {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(.95rem, .8rem + .7vw, 1.4rem);
  margin: .9rem 0 .2rem; color: #f0e2c6;
}
.hero-by { margin: 0 0 1.8rem; font-size: 1rem; color: #cdbfa4; letter-spacing: .06em; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

.scroll-cue {
  position: absolute; z-index: 2; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .45rem;
  color: #d8c9ac; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
}
.scroll-cue i {
  width: 2px; height: 26px; background: currentColor; opacity: .6;
  animation: cue 1.9s ease-in-out infinite;
}
@keyframes cue { 0%,100% { transform: scaleY(.4); opacity: .3; } 50% { transform: scaleY(1); opacity: .8; } }

/* ---------- bands ---------- */
.band { padding: clamp(3.5rem, 9vh, 7rem) 0; position: relative; }
.band-cream { background: var(--cream); color: var(--ink); }
.band-night { background: var(--night); color: #ecdfc6; }
.band-buy   { background: linear-gradient(160deg, var(--cream-2), var(--cream)); color: var(--ink); }

.section-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1.7rem, 1.1rem + 2.3vw, 3rem);
  line-height: 1.08; margin: 0 0 .8rem;
}
.band-night .section-title { color: var(--lantern-2); }
.section-note { opacity: .8; margin: 0 0 2.4rem; }
.lede { font-size: clamp(1.05rem, .98rem + .4vw, 1.3rem); }

/* intro facts */
.facts {
  list-style: none; padding: 0; margin: 2.4rem 0 0;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
}
.facts li {
  background: #fff8e9; border: 2px solid var(--cream-2); border-radius: var(--radius);
  padding: .9rem 1.3rem; min-width: 10.5rem;
}
.facts b { display: block; font-family: var(--display); font-size: 1.1rem; }
.facts span { font-size: .87rem; opacity: .7; }

/* ---------- story spreads ---------- */
.spread {
  width: min(1400px, 94vw); margin: 0 auto clamp(2rem, 5vh, 3.5rem);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  background: #000;
  position: relative;
}
.spread img { width: 100%; height: auto; }
.spread-text {
  padding: 1.4rem clamp(1.1rem, 3vw, 2.2rem) 1.7rem;
  background: linear-gradient(to bottom, rgba(10,17,23,.85), rgba(10,17,23,.97));
  color: #f2e6cd;
}
.spread-text p { margin: 0 0 .7rem; font-size: clamp(1rem, .95rem + .35vw, 1.22rem); }
.spread-text p:last-child { margin-bottom: 0; }

/* On wide screens the words sit on the art, as they do on the page. */
@media (min-width: 900px) {
  .spread-text {
    position: absolute; inset: auto auto 6%  5%;
    width: min(38ch, 42%);
    border-radius: var(--radius);
    background: rgba(9,15,21,.72);
    backdrop-filter: blur(3px);
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
  }
}

.bubble {
  margin: 1rem 0 0; padding: .8rem 1.1rem;
  background: #fffdf6; color: #22190f;
  border-radius: 18px; position: relative;
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1rem, .95rem + .4vw, 1.25rem);
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.bubble::after {
  content: ''; position: absolute; left: 2rem; bottom: -12px;
  border: 12px solid transparent; border-top-color: #fffdf6; border-bottom: 0;
}

.stopper { margin-top: clamp(1.5rem, 4vh, 3rem); }
.stopper-text {
  font-family: var(--display); font-size: clamp(1.15rem, 1rem + .8vw, 1.7rem);
  color: var(--lantern-2); margin: 0 0 1.4rem;
}

/* ---------- cast ---------- */
.cast-grid {
  display: grid; gap: clamp(1rem, 2.5vw, 1.8rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-top: 2.5rem;
}
.card {
  margin: 0; background: #fff8e9;
  border: 2px solid var(--cream-2); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: 0 16px 34px rgba(0,0,0,.18); }
.card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.card figcaption { padding: 1rem 1.15rem 1.3rem; }
.card h3 { font-family: var(--display); font-size: 1.18rem; margin: 0 0 .35rem; line-height: 1.2; }
.card p { margin: 0 0 .55rem; font-size: .95rem; }
.card p:last-child { margin-bottom: 0; }
.says { font-family: var(--display); color: var(--ember); font-size: 1.02rem; }
.faint { opacity: .5; font-family: var(--body); font-style: italic; }

/* ---------- hidden object hunt ---------- */
.checklist {
  list-style: none; padding: 0;
  margin: 0 auto 1rem; max-width: 44rem;
  display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center;
}
.checklist li {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .95rem; border-radius: 999px;
  border: 2px solid rgba(242,169,59,.45);
  font-family: var(--display); font-size: .98rem;
  transition: background-color .2s ease, opacity .2s ease;
}
.checklist li.found {
  background: rgba(109,138,83,.35);
  border-color: var(--moss);
  opacity: .75;
  text-decoration: line-through;
}
.tick {
  width: 1.05rem; height: 1.05rem; border-radius: 50%;
  border: 2px solid currentColor; opacity: .5; flex: none;
}
.checklist li.found .tick {
  opacity: 1; border-color: var(--moss); background: var(--moss);
  box-shadow: inset 0 0 0 2px var(--night);
}
/* The spoon isn't on this page on purpose — the two spreads it appears in are
   the story's payoff. Mark it as a tease rather than leaving it looking dead. */
.checklist li.only-in-book {
  border-style: dashed;
  opacity: .7;
  cursor: default;
}
.checklist li.only-in-book em {
  font-family: var(--body);
  font-style: italic;
  font-size: .8rem;
  opacity: .75;
}

.hunt-status { text-align: center; font-family: var(--display); color: var(--lantern-2); margin: 0 0 2rem; }

.hunt-scenes { display: grid; gap: 1.4rem; }
.scene {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 14px 36px rgba(0,0,0,.4); cursor: crosshair;
}
.scene img { width: 100%; height: auto; }
.hotspot {
  position: absolute; width: 12%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 0; padding: 0; background: transparent;
  border-radius: 50%; cursor: pointer;
}
/* Only revealed once found — otherwise it gives the answer away. */
.hotspot.found {
  background: radial-gradient(circle, rgba(255,210,122,.5) 0%, rgba(255,210,122,0) 70%);
  box-shadow: 0 0 0 4px rgba(255,210,122,.85) inset;
  animation: pop .45s ease;
}
@keyframes pop { 0% { transform: translate(-50%,-50%) scale(.4); } 60% { transform: translate(-50%,-50%) scale(1.15); } 100% { transform: translate(-50%,-50%) scale(1); } }

.scene-miss {
  position: absolute; width: 2rem; height: 2rem; margin: -1rem 0 0 -1rem;
  border-radius: 50%; border: 3px solid rgba(255,255,255,.7);
  pointer-events: none; animation: miss .6s ease forwards;
}
@keyframes miss { to { transform: scale(2.2); opacity: 0; } }

.hunt-win {
  margin: 1.6rem auto 0; max-width: 34rem; text-align: center;
  background: rgba(109,138,83,.2); border: 2px solid var(--moss);
  border-radius: var(--radius); padding: 1.2rem 1.4rem;
  font-family: var(--display); font-size: 1.15rem; color: var(--lantern-2);
}

/* ---------- buy ---------- */
.buy-grid {
  display: grid; gap: clamp(1.6rem, 4vw, 3.2rem); align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) { .buy-grid { grid-template-columns: 380px 1fr; } }
.buy-cover img {
  width: 100%; border-radius: 10px;
  box-shadow: 0 22px 44px rgba(0,0,0,.32), 0 0 0 1px rgba(0,0,0,.08);
  transform: rotate(-1.5deg);
}
.buy-blurb { max-width: 42ch; }
.formats { list-style: none; padding: 0; margin: 1.6rem 0 1.2rem; display: grid; gap: .7rem; }
.formats li {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #fff8e9; border: 2px solid var(--cream-2);
  border-radius: var(--radius); padding: .8rem 1.1rem;
}
.fmt { font-family: var(--display); font-weight: 600; font-size: 1.08rem; min-width: 8rem; }
.fmt small { font-weight: 400; opacity: .6; }
.price { font-family: var(--display); font-size: 1.25rem; color: var(--ember); margin-right: auto; }
.isbn { font-size: .84rem; opacity: .6; margin: 0; }

/* ---------- signup ---------- */
.signup { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; }
.signup input[type=email] {
  font: inherit; padding: .75rem 1.1rem; min-width: min(20rem, 80vw);
  border: 2px solid var(--cream-2); border-radius: 999px; background: #fff8e9; color: var(--ink);
}
.signup input[type=email]:focus { border-color: var(--lantern); outline: none; }
.hp { position: absolute; left: -9999px; }
.signup-msg { flex-basis: 100%; margin: .8rem 0 0; font-weight: 600; min-height: 1.4em; }
.signup-msg.ok  { color: #4a6b3f; }
.signup-msg.bad { color: var(--ember); }
.fineprint { font-size: .82rem; opacity: .6; margin-top: .9rem; }

/* ---------- author ---------- */
.author-grid { display: grid; gap: clamp(1.4rem, 4vw, 3rem); align-items: center; }
@media (min-width: 900px) { .author-grid { grid-template-columns: 1.15fr 1fr; } }
.author-art img { border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.author-text p { margin: 0 0 .9rem; }
.motto {
  margin: 1.4rem 0 0; padding: 1rem 1.3rem;
  border-left: 4px solid var(--lantern);
  background: rgba(255,255,255,.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--display); font-size: 1.08rem; color: var(--lantern-2);
}

/* ---------- footer ---------- */
.footer { background: var(--night-2); color: #b9ab90; padding: 3rem 0 5.5rem; text-align: center; }
.footer-title { font-family: var(--display); font-size: 1.35rem; color: var(--cream); margin: 0 0 1rem; }
.copy { font-size: .82rem; opacity: .6; margin: 1.4rem 0 0; }

/* ---------- sticky buy (small screens) ---------- */
.sticky-buy {
  position: fixed; z-index: 90; left: 50%; bottom: .9rem; transform: translateX(-50%);
  display: none;
  font-family: var(--display); font-weight: 600; text-decoration: none;
  background: var(--lantern); color: #43290a;
  padding: .8em 1.8em; border-radius: 999px;
  box-shadow: 0 6px 0 #b9781f, 0 12px 26px rgba(0,0,0,.4);
}
@media (max-width: 560px) {
  .sticky-buy { display: block; }
  .sticky-buy[hidden] { display: none; }
  /* The sticky button lands exactly where the scroll cue sits, so on small
     screens the cue gives way — the button already invites a tap. */
  .scroll-cue { display: none; }
}
