:root {
  --bg-deep: #2f4a2b;
  --bg-mid: #8a9c4e;
  --cream: #fffaf0;
  --text-dark: #4a3520;
  --accent-yellow: #f5c542;
  --accent-green: #6fae4e;
  --accent-brown: #a9713f;
  --accent-blue: #6fb8d6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Baloo 2', 'Comic Sans MS', 'Trebuchet MS', sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
}

.home-link {
  background: #fff;
  color: var(--text-dark);
  font-weight: bold;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.top-nav {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  gap: 10px;
}

/* ---------- Abstract background: gradient + glow orbs + peeking eyes ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #a8dff5 0%, #fff3d6 45%, #cfe07a 100%);
}

.sun {
  position: absolute;
  top: 6%;
  right: 8%;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6c8, #ffcf4d 60%, #ffb830 100%);
  box-shadow: 0 0 70px 24px rgba(255, 214, 92, 0.45);
}

.cloud {
  position: absolute;
  background: #fff;
  border-radius: 50px;
  opacity: 0.85;
}

.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}

.cloud--1 { top: 8%;  left: 10%; width: 100px; height: 36px; }
.cloud--1::before { width: 50px; height: 50px; top: -25px; left: 10px; }
.cloud--1::after  { width: 60px; height: 60px; top: -30px; left: 45px; }

.cloud--2 { top: 16%; left: 58%; width: 80px; height: 30px; transform: scale(0.8); }
.cloud--2::before { width: 40px; height: 40px; top: -20px; left: 8px; }
.cloud--2::after  { width: 50px; height: 50px; top: -24px; left: 36px; }

.cloud--3 { top: 3%;  left: 32%; width: 70px; height: 26px; transform: scale(0.7); opacity: 0.7; }
.cloud--3::before { width: 34px; height: 34px; top: -17px; left: 6px; }
.cloud--3::after  { width: 42px; height: 42px; top: -20px; left: 30px; }

.decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.decor-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.35;
}

.decor-orb--1 {
  width: 240px; height: 240px;
  top: -60px; left: -60px;
  background: radial-gradient(circle at 30% 30%, var(--accent-yellow), transparent 70%);
}

.decor-orb--2 {
  width: 280px; height: 280px;
  bottom: -90px; right: -70px;
  background: radial-gradient(circle at 30% 30%, var(--accent-brown), transparent 70%);
}

.decor-orb--3 {
  width: 170px; height: 170px;
  top: 40%; left: 8%;
  background: radial-gradient(circle at 30% 30%, var(--accent-green), transparent 70%);
}

.eye-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.eye-pair {
  position: absolute;
  display: flex;
  gap: 10px;
}

.cartoon-eye {
  position: relative;
  width: 34px;
  height: 34px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  animation: blink 5s ease-in-out infinite;
}

.iris {
  position: absolute;
  width: 62%;
  height: 62%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 35% 30%, #a9713f 0%, #6e4529 70%, #4a2f1a 100%);
  border-radius: 50%;
}

.pupil {
  position: absolute;
  width: 55%;
  height: 55%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #2b1a0f;
  border-radius: 50%;
}

.glint {
  position: absolute;
  width: 30%;
  height: 30%;
  top: 18%;
  left: 20%;
  background: #fff;
  border-radius: 50%;
  opacity: 0.9;
}

.lash {
  position: absolute;
  width: 3px;
  height: 11px;
  background: #2b1a0f;
  border-radius: 2px;
  top: -6px;
}

.lash--1 { left: 20%; transform: rotate(-25deg); }
.lash--2 { left: 45%; transform: rotate(0deg); }
.lash--3 { left: 68%; transform: rotate(25deg); }

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}

.eye-pair--1 { top: 8%;  left: 10%; }
.eye-pair--2 { top: 16%; left: 78%; transform: scale(0.75); }
.eye-pair--3 { top: 30%; left: 42%; transform: scale(0.55); }
.eye-pair--4 { top: 44%; left: 88%; transform: scale(0.7); }
.eye-pair--5 { top: 58%; left: 6%;  transform: scale(0.85); }
.eye-pair--6 { top: 72%; left: 58%; transform: scale(0.6); }
.eye-pair--7 { top: 86%; left: 25%; transform: scale(0.75); }

.eye-pair--2 .cartoon-eye { animation-delay: 0.6s; }
.eye-pair--3 .cartoon-eye { animation-delay: 1.2s; }
.eye-pair--4 .cartoon-eye { animation-delay: 1.8s; }
.eye-pair--5 .cartoon-eye { animation-delay: 2.4s; }
.eye-pair--6 .cartoon-eye { animation-delay: 3s; }
.eye-pair--7 .cartoon-eye { animation-delay: 3.6s; }

/* ---------- Page content ---------- */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 80px;
}

.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.book-title {
  font-family: 'Fredericka the Great', cursive;
  font-size: clamp(2.8rem, 8vw, 4.6rem);
  color: var(--accent-yellow);
  margin: 0;
  text-shadow:
    2px 2px 0 var(--bg-deep),
    -1px -1px 0 var(--bg-deep),
    1px -1px 0 var(--bg-deep),
    -1px 1px 0 var(--bg-deep),
    3px 4px 6px rgba(0,0,0,0.3);
}

.book-author {
  font-family: 'Chewy', cursive;
  font-size: 1.3rem;
  font-weight: 400;
  margin: 10px 0 0;
  color: #1f7a4d;
  text-shadow:
    1px 1px 0 #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    0 3px 4px rgba(0,0,0,0.2);
}

.book-tagline {
  font-family: 'Chewy', cursive;
  font-size: 1.3rem;
  font-weight: 400;
  margin: 4px 0 0;
  color: #1f7a4d;
  text-shadow:
    1px 1px 0 #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    0 3px 4px rgba(0,0,0,0.2);
}

/* ---------- Landing page ---------- */
.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 48px 24px;
  text-align: center;
}

.cover-image {
  width: min(380px, 80vw);
  filter: drop-shadow(0 14px 18px rgba(0,0,0,0.25));
  animation: bob 4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.landing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.35);
  padding: 10px 24px 10px 10px;
  border-radius: 60px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.1);
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.author-info {
  text-align: left;
}

.author-name {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-dark);
}

.author-narrate {
  font-size: 0.9rem;
  margin: 2px 0 0;
  color: var(--text-dark);
  opacity: 0.8;
}

.start-btn {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark);
  background: var(--accent-yellow);
  border: none;
  border-radius: 50px;
  padding: 18px 44px;
  text-decoration: none;
  box-shadow: 0 8px 0 rgba(0,0,0,0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.start-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 rgba(0,0,0,0.2);
}

.start-btn:active {
  transform: translateY(3px);
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

/* ---------- Story grid ---------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
  max-width: 1200px;
  width: 100%;
}

.story-card {
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  text-align: center;
  position: relative;
  transition: transform 0.15s ease;
}

.story-card:hover {
  transform: translateY(-6px);
}

.story-card--tbd {
  opacity: 0.6;
}

.letter-badge {
  position: absolute;
  top: -18px;
  left: 4px;
  font-family: 'Fredericka the Great', cursive;
  font-size: 1.8rem;
  color: var(--accent-yellow);
  text-shadow:
    1.5px 1.5px 0 var(--bg-deep),
    -1px -1px 0 var(--bg-deep),
    1px -1px 0 var(--bg-deep),
    -1px 1px 0 var(--bg-deep);
  z-index: 2;
}

.story-grid .story-card:nth-child(3n+1) .letter-badge { color: var(--accent-yellow); }
.story-grid .story-card:nth-child(3n+2) .letter-badge { color: var(--accent-green); }
.story-grid .story-card:nth-child(3n) .letter-badge   { color: var(--accent-blue); }

.story-image-placeholder {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15);
}

.story-image-placeholder--filled {
  background: var(--cream);
  border: 4px solid #fff;
  padding: 0;
  overflow: hidden;
}

.story-image-placeholder--filled::before {
  content: none;
}

.story-image-placeholder--filled img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Englebert's and Camellia's source images have extra whitespace padding, so scale them up a bit */
.story-card[data-letter="E"] img {
  transform: scale(1.4);
}

.story-card[data-letter="C"] img {
  transform: scale(1.15);
}

.story-title {
  font-family: 'Chewy', cursive;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.3;
  color: #1f7a4d;
  text-shadow:
    1px 1px 0 #fff,
    -1px -1px 0 #fff,
    1px -1px 0 #fff,
    -1px 1px 0 #fff,
    0 3px 4px rgba(0,0,0,0.2);
  max-width: 160px;
}
