/* One More Story  |  Brand palette: dark brown 2C1F17, amber C47C2B, cream F5EFE6, outline 54290E */

:root {
  --brown: #2C1F17;
  --brown-deep: #1E1510;
  --brown-card: #3A2B1F;
  --brown-line: #4A382A;
  --amber: #C47C2B;
  --amber-soft: #D89A55;
  --cream: #F5EFE6;
  --cream-dim: #D9CFC0;
  --outline: #54290E;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--brown);
  color: var(--cream);
  font-family: 'ABeeZee', sans-serif;
  font-size: 1.05rem;
  line-height: 1.75;
}

h1, h2, h3 { font-family: 'Fredoka', sans-serif; font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

.ep-title { font-family: 'Lilita One', sans-serif; font-weight: 400; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--amber-soft); }

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

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.4rem; position: relative; z-index: 1; }
.narrow { max-width: 760px; }

section { padding: 4.5rem 0; position: relative; }
body { overflow-x: hidden; }

.muted { color: var(--cream-dim); }
.center { text-align: center; }

/* Star divider, echoing the flyer */
.star-divider {
  text-align: center;
  color: var(--amber);
  letter-spacing: 0.9em;
  font-size: 0.8rem;
  padding: 0.4rem 0 0.4rem 0.9em;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Navigation ---------- */
header.site {
  background: var(--brown-deep);
  border-bottom: 1px solid var(--brown-line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0.7rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.nav .brand img { height: 46px; width: auto; }
.nav ul {
  list-style: none;
  display: flex;
  gap: 1.3rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav a { text-decoration: none; color: var(--cream); font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 1rem; }
.nav a:hover, .nav a.active { color: var(--amber-soft); }

/* ---------- Hero / night sky ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(196,124,43,0.28) 0%, rgba(196,124,43,0) 55%),
    linear-gradient(180deg, #171019 0%, #241a14 60%, var(--brown) 100%);
  text-align: center;
  padding: 5.5rem 0 4.5rem;
}
.hero .wrap { position: relative; z-index: 2; }
.hero img.hero-logo { width: min(420px, 78vw); margin: 0 auto 2rem; }
.hero p.lead {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  max-width: 34em;
  margin: 0 auto 2.2rem;
  color: var(--cream-dim);
}

.stars, .stars::before, .stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #F5EFE6cc 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 64%, #F5EFE699 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 41% 15%, #F5EFE6aa 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 42%, #F5EFE688 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 18%, #F5EFE6bb 50%, transparent 51%),
    radial-gradient(1px 1px at 79% 55%, #F5EFE699 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 30%, #F5EFE6aa 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 48%, #F5EFE677 50%, transparent 51%),
    radial-gradient(1px 1px at 49% 70%, #F5EFE666 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 96% 62%, #F5EFE688 50%, transparent 51%);
  pointer-events: none;
}
.stars { animation: twinkle 9s ease-in-out infinite alternate; }
.stars::before { transform: translate(-4%, 14%) scale(1.35); opacity: 0.55; animation: twinkle 6s ease-in-out infinite alternate-reverse; }
.stars::after { transform: translate(3%, 9%) scale(1.18); opacity: 0.6; animation: twinkle 7s ease-in-out infinite alternate; animation-delay: -3s; }
@keyframes twinkle {
  0%   { opacity: 0.3; }
  100% { opacity: 0.9; }
}

/* Hero embers: warm specks rising gently through the night sky */
.hero .ember-rise {
  position: absolute;
  bottom: 8%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #E8B86D;
  box-shadow: 0 0 7px 2px rgba(232,184,109,0.45);
  opacity: 0;
  pointer-events: none;
  animation: hero-ember 14s linear infinite;
}
.hero .ember-rise.h2 { animation-duration: 19s; animation-delay: -7s; width: 3px; height: 3px; }
.hero .ember-rise.h3 { animation-duration: 24s; animation-delay: -13s; width: 3px; height: 3px; }
.hero .ember-rise.h4 { animation-duration: 17s; animation-delay: -4s; }
@keyframes hero-ember {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  10%  { opacity: 0.7; }
  55%  { opacity: 0.35; transform: translate(30px, -38vh) scale(0.7); }
  100% { transform: translate(-12px, -70vh) scale(0.3); opacity: 0; }
}
/* Crescent moon, soft and still */
.hero .moon {
  position: absolute;
  top: 14%;
  right: 12%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: inset -14px 9px 0 0 rgba(245,239,230,0.8);
  opacity: 0.85;
  pointer-events: none;
  transform: rotate(-14deg);
}

/* A slow shooting star, once in a while */
.hero .shooting-star {
  position: absolute;
  top: 18%;
  left: 70%;
  width: 110px;
  height: 1.5px;
  background: linear-gradient(90deg, rgba(245,239,230,0.9), transparent);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: rotate(160deg);
  animation: shoot 26s linear infinite;
}
.hero .shooting-star.s2 { top: 30%; left: 24%; animation-duration: 37s; animation-delay: -19s; width: 80px; }
@keyframes shoot {
  0%    { transform: rotate(160deg) translateX(0); opacity: 0; }
  86%   { transform: rotate(160deg) translateX(0); opacity: 0; }
  88%   { opacity: 0.8; }
  93%   { transform: rotate(160deg) translateX(340px); opacity: 0; }
  100%  { transform: rotate(160deg) translateX(340px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .stars, .stars::before, .stars::after, .hero .ember-rise, .hero .shooting-star { animation: none; }
  .hero .ember-rise, .hero .shooting-star { display: none; }
}

/* ---------- Hearth: soft fire glow, bottom left ---------- */
.hearth {
  position: fixed;
  left: 0;
  bottom: 0;
  width: min(60vw, 720px);
  height: 45vh;
  pointer-events: none;
  z-index: 4;
  background: radial-gradient(ellipse at 0% 100%,
    rgba(232,160,70,0.26) 0%,
    rgba(196,124,43,0.14) 35%,
    rgba(196,124,43,0.05) 55%,
    transparent 72%);
  animation: hearth-breathe 8s ease-in-out infinite;
}
@keyframes hearth-breathe {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}
.ember {
  position: fixed;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #E8B86D;
  box-shadow: 0 0 8px 2px rgba(232,184,109,0.5);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  animation: ember-rise 16s linear infinite;
}
.ember.e1 { left: 3%; animation-duration: 17s; }
.ember.e2 { left: 7%; animation-duration: 23s; animation-delay: -9s; width: 3px; height: 3px; }
.ember.e3 { left: 12%; animation-duration: 28s; animation-delay: -17s; width: 3px; height: 3px; }
@keyframes ember-rise {
  0%   { transform: translate(0, 0) scale(1); opacity: 0; }
  8%   { opacity: 0.75; }
  60%  { opacity: 0.35; }
  100% { transform: translate(48px, -55vh) scale(0.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hearth, .ember, .stars::after { animation: none; }
  .ember { display: none; }
}

.firefly {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #E8B86D;
  box-shadow: 0 0 10px 3px rgba(232,184,109,0.55);
  opacity: 0.7;
  animation: drift 16s ease-in-out infinite;
  pointer-events: none;
}
.firefly:nth-child(2) { animation-delay: -5s; animation-duration: 21s; }
.firefly:nth-child(3) { animation-delay: -11s; animation-duration: 26s; }
@keyframes drift {
  0%   { transform: translate(0, 0); opacity: 0.25; }
  25%  { transform: translate(34px, -26px); opacity: 0.8; }
  50%  { transform: translate(-22px, -52px); opacity: 0.4; }
  75%  { transform: translate(20px, -20px); opacity: 0.75; }
  100% { transform: translate(0, 0); opacity: 0.25; }
}
@media (prefers-reduced-motion: reduce) {
  .firefly { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  padding: 0.8rem 1.7rem;
  border-radius: 999px;
  margin: 0.3rem 0.35rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-amber { background: var(--amber); color: var(--brown-deep); }
.btn-amber:hover { background: var(--amber-soft); }
.btn-ghost { border: 2px solid var(--amber); color: var(--cream); }
.btn-cream { background: var(--cream); color: var(--brown-deep); }

/* ---------- Cards and grids ---------- */
.card {
  background: var(--brown-card);
  border: 1px solid var(--brown-line);
  border-radius: 18px;
  padding: 1.8rem;
}
.grid { display: grid; gap: 1.6rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* split section: text beside image */
.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}
.split.flip { grid-template-columns: 0.8fr 1.2fr; }
@media (max-width: 760px) {
  .split, .split.flip { grid-template-columns: 1fr; }
}
.split img.character { max-height: 360px; width: auto; margin: 0 auto; }

/* ---------- Video embeds ---------- */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--brown-line);
  background: var(--brown-deep);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Books ---------- */
.book-card { text-align: center; display: flex; flex-direction: column; }
.book-card img { border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,0.45); margin-bottom: 1.1rem; }
.book-card .links { margin-top: auto; padding-top: 0.8rem; }
.book-card .links a { display: block; margin: 0.3rem 0; font-size: 0.98rem; }
.tag {
  display: inline-block;
  background: var(--amber);
  color: var(--brown-deep);
  font-family: 'Fredoka', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.1rem 0.75rem;
  margin-bottom: 0.6rem;
}
.tag.soft { background: var(--brown-line); color: var(--cream-dim); }

/* ---------- Illustration process ---------- */
.process-row { align-items: end; }
.process-row figure { text-align: center; }
.process-row img {
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid var(--brown-line);
}
.process-row img.on-dark { background: transparent; }
.process-row figcaption {
  font-family: 'Fredoka', sans-serif;
  color: var(--cream-dim);
  margin-top: 0.6rem;
  font-size: 0.95rem;
}

/* ---------- Mission strip ---------- */
.mission {
  background:
    radial-gradient(ellipse at 50% 130%, rgba(196,124,43,0.22) 0%, rgba(196,124,43,0) 60%),
    var(--brown-deep);
  text-align: center;
}
.mission blockquote {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  max-width: 26em;
  margin: 0 auto;
  line-height: 1.5;
}
.mission cite { display: block; margin-top: 1.2rem; font-style: normal; color: var(--cream-dim); font-family: 'ABeeZee', sans-serif; font-size: 1rem; }

/* ---------- Email signup ---------- */
.signup form {
  display: flex;
  gap: 0.6rem;
  max-width: 480px;
  margin: 1.4rem auto 0;
  flex-wrap: wrap;
  justify-content: center;
}
.signup input[type="email"] {
  flex: 1 1 260px;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--brown-line);
  background: var(--cream);
  color: var(--brown-deep);
  font-family: 'ABeeZee', sans-serif;
  font-size: 1rem;
}
.signup button {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  background: var(--amber);
  color: var(--brown-deep);
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  cursor: pointer;
}
.signup button:hover { background: var(--amber-soft); }

/* ---------- Tables (educators) ---------- */
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; }
th, td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--brown-line); vertical-align: top; }
th { font-family: 'Fredoka', sans-serif; font-weight: 600; color: var(--amber-soft); }

/* ---------- Footer ---------- */
footer.site {
  background: var(--brown-deep);
  border-top: 1px solid var(--brown-line);
  padding: 3rem 0 2.2rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--cream-dim);
  position: relative;
  overflow: hidden;
}
footer.site .foot-links { margin: 0.8rem 0 1.2rem; }
footer.site .foot-links a { margin: 0 0.7rem; text-decoration: none; }
footer.site .signoff { font-family: 'Fredoka', sans-serif; color: var(--cream); font-size: 1.05rem; margin-top: 1.2rem; }

.disclosure { font-size: 0.85rem; color: var(--cream-dim); max-width: 46em; margin: 1.5rem auto 0; }

/* ---------- Flora and fauna, the real ambient assets ---------- */
/* Drawn from the books' own background pack. Kept small, soft and behind the */
/* story, in the spirit of the title page corners, never the busy spread.     */
.deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  will-change: transform;
}
.deco.bee       { width: 42px;  height: 42px;  opacity: 0.6;  background-image: url('../assets/fauna/bee.png'); }
.deco.butterfly { width: 56px;  height: 56px;  opacity: 0.62; background-image: url('../assets/fauna/butterfly.png'); }
.deco.dragonfly { width: 88px;  height: 58px;  opacity: 0.5;  background-image: url('../assets/fauna/dragonfly.png'); }
.deco.ladybug   { width: 34px;  height: 34px;  opacity: 0.6;  background-image: url('../assets/fauna/ladybug.png'); }
.deco.glider   { width: 74px;  height: 66px;  opacity: 0.5;  background-image: url('../assets/fauna/sugarglider.png'); filter: drop-shadow(0 0 5px rgba(232,184,109,0.4)); }
.deco.frog      { width: 58px;  height: 40px;  opacity: 0.55; background-image: url('../assets/fauna/frog.png'); }
.deco.cicada    { width: 52px;  height: 56px;  opacity: 0.5;  background-image: url('../assets/fauna/cicada.png'); }
.deco.reed      { width: 150px; height: 150px; opacity: 0.5;  background-image: url('../assets/fauna/reed.png'); }
.deco.owl       { width: 96px;  height: 96px;  opacity: 0.72; background-image: url('../assets/fauna/owl.png'); }

/* Gentle, optional motion. Off entirely for reduced-motion visitors. */
@media (prefers-reduced-motion: no-preference) {
  .deco.sway { animation: deco-sway 9s ease-in-out infinite; transform-origin: center bottom; }
  .deco.bob  { animation: deco-bob 7s ease-in-out infinite; }
  .deco.flit { animation: deco-flit 15s ease-in-out infinite; }
  .deco.glide { animation: deco-glide 24s ease-in-out infinite; }
}
@keyframes deco-glide {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(-46px, 34px) rotate(-5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes deco-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes deco-bob  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes deco-flit {
  0%   { transform: translate(0, 0) rotate(-2deg); }
  25%  { transform: translate(16px, -12px) rotate(2deg); }
  50%  { transform: translate(28px, 4px) rotate(-1deg); }
  75%  { transform: translate(12px, 14px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(-2deg); }
}

/* A boobook owl keeping watch, and reeds at the water's edge, to close each page. */
.footer-life .owl  { right: 4%; bottom: 6px; }
.footer-life .reed { left: -10px; bottom: -18px; opacity: 0.45; }

/* Reeds along the bottom of the night-sky hero, like a quiet waterhole edge. */
.hero .deco.reed { z-index: 1; opacity: 0.42; left: -16px; bottom: -22px; height: 170px; width: 170px; }
.hero .deco.reed.r { left: auto; right: -16px; bottom: -26px; transform: scaleX(-1); }
.hero .deco.dragonfly { z-index: 1; }
.hero .deco.glider { z-index: 1; }

@media (max-width: 640px) {
  .deco.reed { width: 104px; height: 104px; }
  .hero .deco.reed { width: 116px; height: 116px; }
  .deco.owl  { width: 66px; height: 66px; }
  .deco.hide-sm { display: none; }
}
