:root {
  --cream: #fff8ed;
  --cream-2: #fff1dc;
  --peach: #ffd6c9;
  --pink: #f8b7cf;
  --lavender: #cfc7ff;
  --blue: #bfe8ff;
  --mint: #c8f5dc;
  --sun: #ffe38a;
  --ink: #26324b;
  --muted: #68708b;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(65, 76, 116, 0.16);
  --shadow-soft: 0 16px 40px rgba(65, 76, 116, 0.11);
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 227, 138, 0.55), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(207, 199, 255, 0.55), transparent 28%),
    radial-gradient(circle at 75% 82%, rgba(191, 232, 255, 0.55), transparent 30%),
    linear-gradient(135deg, var(--cream), #f9fbff 48%, var(--cream-2));
  font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image: radial-gradient(circle, rgba(38, 50, 75, 0.08) 1.4px, transparent 1.4px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  z-index: -2;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.page-shell {
  position: relative;
  min-height: 100vh;
}

.blob {
  position: fixed;
  border-radius: 999px;
  filter: blur(3px);
  opacity: 0.52;
  z-index: -1;
  animation: floatBlob 9s ease-in-out infinite;
}

.blob.one {
  width: 190px;
  height: 190px;
  left: -55px;
  top: 280px;
  background: var(--pink);
}

.blob.two {
  width: 240px;
  height: 240px;
  right: -85px;
  top: 130px;
  background: var(--blue);
  animation-delay: -2.5s;
}

.blob.three {
  width: 180px;
  height: 180px;
  right: 12%;
  bottom: 70px;
  background: var(--mint);
  animation-delay: -5s;
}

@keyframes floatBlob {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(16px, -22px, 0) scale(1.04); }
}

.topbar {
  width: min(var(--max), calc(100% - 36px));
  margin: 20px auto 0;
  padding: 14px 16px 14px 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 14px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 17px;
  background:
    radial-gradient(circle at 30% 28%, #fff 0 11%, transparent 12%),
    linear-gradient(135deg, var(--lavender), var(--pink) 55%, var(--sun));
  display: grid;
  place-items: center;
  box-shadow: inset 0 -8px 18px rgba(255, 255, 255, 0.34), 0 10px 25px rgba(113, 98, 184, 0.22);
  transform: rotate(-4deg);
}

.brand-mark span {
  font-size: 25px;
  transform: rotate(4deg);
}

.brand-title {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 1.22rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #566078;
  font-weight: 900;
  font-size: 0.93rem;
}

.nav-links a {
  padding: 10px 14px;
  border-radius: 999px;
  transition: 0.24s ease;
}

.nav-links a:hover {
  background: rgba(207, 199, 255, 0.28);
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 950;
  color: var(--ink);
  transition: transform 0.2s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.05);
}

.btn-primary {
  background: linear-gradient(135deg, #ffe08a, #ffbed6 52%, #c7c3ff);
  box-shadow: 0 16px 34px rgba(248, 183, 207, 0.34);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(38, 50, 75, 0.08);
  box-shadow: 0 12px 26px rgba(65, 76, 116, 0.09);
}

.btn-dark {
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 30px rgba(38, 50, 75, 0.22);
}

.hero {
  width: min(var(--max), calc(100% - 36px));
  margin: 42px auto 0;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 38px;
  align-items: center;
  min-height: calc(100vh - 130px);
  padding: 26px 0 70px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  padding: 9px 14px;
  color: #6b5b95;
  font-weight: 950;
  font-size: 0.9rem;
}

.hero h1 {
  margin: 22px 0 18px;
  font-family: "Baloo 2", cursive;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.hero h1 span {
  display: inline-block;
  background: linear-gradient(110deg, #5a5ed9, #ef77aa 45%, #e7a412 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmerText 7s linear infinite;
  background-size: 180% 100%;
}

@keyframes shimmerText {
  0% { background-position: 0% 50%; }
  100% { background-position: 180% 50%; }
}

.hero p {
  max-width: 620px;
  color: #566078;
  font-size: 1.19rem;
  line-height: 1.72;
  margin: 0 0 28px;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}

.trust-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
  font-size: 0.95rem;
}

.trust-pill {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.85);
  padding: 10px 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 10px 22px rgba(65, 76, 116, 0.08);
}

.hero-stage {
  min-height: 620px;
  position: relative;
  perspective: 1200px;
}

.story-orbit {
  position: absolute;
  inset: 30px 0 0;
  display: grid;
  place-items: center;
}

.main-book {
  width: min(390px, 78vw);
  aspect-ratio: 0.72;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0) 34%),
    linear-gradient(155deg, #8990ff, #ffd1e2 48%, #ffe79b);
  border-radius: 30px 22px 22px 30px;
  box-shadow: 0 36px 80px rgba(82, 80, 159, 0.28);
  position: relative;
  transform: rotateY(-13deg) rotateZ(3deg);
  animation: bookFloat 5s ease-in-out infinite;
  overflow: hidden;
  border: 9px solid rgba(255, 255, 255, 0.55);
}

@keyframes bookFloat {
  0%, 100% { transform: rotateY(-13deg) rotateZ(3deg) translateY(0); }
  50% { transform: rotateY(-10deg) rotateZ(1deg) translateY(-16px); }
}

.main-book::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38px;
  background: rgba(38, 50, 75, 0.13);
  box-shadow: inset -10px 0 20px rgba(255,255,255,0.2);
}

.main-book::after {
  content: "";
  position: absolute;
  inset: 22px;
  border: 2px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  pointer-events: none;
}

.book-art {
  position: absolute;
  inset: 66px 38px 34px 58px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
}

.moon {
  width: 105px;
  height: 105px;
  border-radius: 999px;
  background: #fff8c8;
  box-shadow: 0 0 45px rgba(255, 248, 200, 0.9);
  position: absolute;
  top: 4px;
  right: 8px;
}

.hill {
  width: 100%;
  height: 42%;
  border-radius: 50% 50% 18px 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.5), rgba(200,245,220,0.88));
  position: absolute;
  bottom: 38px;
  left: 0;
}

.fox {
  position: absolute;
  bottom: 82px;
  left: 48px;
  width: 104px;
  height: 90px;
  filter: drop-shadow(0 10px 12px rgba(38,50,75,0.13));
}

.fox .body {
  position: absolute;
  bottom: 0;
  left: 15px;
  width: 72px;
  height: 54px;
  background: #f6a15f;
  border-radius: 48% 48% 38% 38%;
}

.fox .head {
  position: absolute;
  left: 18px;
  bottom: 38px;
  width: 68px;
  height: 58px;
  background: #f6a15f;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.fox .chest {
  position: absolute;
  left: 37px;
  bottom: 0;
  width: 28px;
  height: 48px;
  background: #fff3df;
  border-radius: 999px 999px 20px 20px;
}

.fox .tail {
  position: absolute;
  right: -12px;
  bottom: 10px;
  width: 62px;
  height: 25px;
  background: #f6a15f;
  border-radius: 999px;
  transform: rotate(-28deg);
}

.fox .tail::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 23px;
  height: 25px;
  background: #fff3df;
  border-radius: 999px;
}

.book-title-cover {
  position: absolute;
  left: 56px;
  right: 34px;
  bottom: 38px;
  font-family: "Baloo 2", cursive;
  font-size: 2.3rem;
  line-height: 0.95;
  font-weight: 800;
  color: white;
  text-shadow: 0 4px 18px rgba(70, 60, 130, 0.24);
}

.floating-card {
  position: absolute;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: floaty 6s ease-in-out infinite;
}

.floating-card strong {
  display: block;
  font-family: "Baloo 2", cursive;
  font-size: 1.08rem;
  line-height: 1;
}

.floating-card small {
  color: var(--muted);
  font-weight: 800;
}

.floating-card .icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--mint), var(--blue));
  font-size: 1.45rem;
}

.card-a { left: 0; top: 92px; }
.card-b { right: 2px; top: 225px; animation-delay: -2s; }
.card-c { left: 45px; bottom: 100px; animation-delay: -4s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(1.5deg); }
}

.sparkle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  opacity: 0.9;
  animation: twinkle 2.8s ease-in-out infinite;
}

.sparkle.s1 { top: 84px; right: 130px; }
.sparkle.s2 { top: 410px; right: 70px; animation-delay: -0.8s; }
.sparkle.s3 { top: 250px; left: 70px; animation-delay: -1.6s; }

@keyframes twinkle {
  0%, 100% { transform: scale(0.7) rotate(0deg); opacity: 0.35; }
  50% { transform: scale(1.55) rotate(35deg); opacity: 1; }
}

section {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-kicker {
  color: #8a6fb5;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.section-heading h2 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.2rem, 4vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.section-heading p {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 700;
}

.library-section { padding: 76px 0 48px; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.search-box {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 999px;
  padding: 0 16px;
  border: 1px solid rgba(38,50,75,0.07);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 14px 2px;
  color: var(--ink);
  font-weight: 800;
  background: transparent;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  border: 0;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.75);
  color: #626b84;
  font-weight: 900;
  transition: 0.2s ease;
}

.filter-pill.active,
.filter-pill:hover {
  background: var(--ink);
  color: white;
  transform: translateY(-1px);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.book-card {
  position: relative;
  min-height: 390px;
  padding: 14px;
  border-radius: 30px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
  isolation: isolate;
}

.book-card:hover {
  transform: translateY(-9px) rotate(-0.5deg);
  box-shadow: var(--shadow);
}

.book-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 10%, rgba(255,255,255,0.8), transparent 30%);
  z-index: -1;
}

.book-cover {
  height: 228px;
  border-radius: 23px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 -20px 40px rgba(38,50,75,0.08), 0 16px 25px rgba(65,76,116,0.13);
  transform-origin: left center;
  transition: transform 0.28s ease;
  background-size: cover;
  background-position: center;
}

.book-card:hover .book-cover {
  transform: rotateY(-7deg) rotateZ(-1deg);
}

.cover-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 27px;
  background: rgba(38,50,75,0.13);
  box-shadow: inset -8px 0 16px rgba(255,255,255,0.28);
  z-index: 2;
}

.cover-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 950;
  font-size: 0.78rem;
  color: #67568f;
  box-shadow: 0 10px 18px rgba(38,50,75,0.08);
  z-index: 4;
}

.cover-emoji {
  position: absolute;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  font-size: 4.6rem;
  filter: drop-shadow(0 14px 12px rgba(38,50,75,0.12));
  animation: coverBounce 4.2s ease-in-out infinite;
  z-index: 3;
}

@keyframes coverBounce {
  0%, 100% { transform: translate(-50%, -50%) rotate(-2deg); }
  50% { transform: translate(-50%, -56%) rotate(3deg); }
}

.cover-title {
  position: absolute;
  left: 42px;
  right: 16px;
  bottom: 17px;
  color: white;
  font-family: "Baloo 2", cursive;
  font-size: 1.52rem;
  line-height: 0.94;
  font-weight: 800;
  text-shadow: 0 3px 18px rgba(38,50,75,0.22);
  z-index: 4;
}

.book-info { padding: 15px 4px 2px; }

.book-info h3 {
  margin: 0 0 5px;
  font-family: "Baloo 2", cursive;
  font-size: 1.34rem;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.book-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0 13px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 950;
  color: #656f86;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(38,50,75,0.06);
}

.book-info p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 700;
  font-size: 0.93rem;
}

.book-actions {
  display: flex;
  gap: 8px;
}

.book-actions .btn {
  flex: 1;
  padding: 11px 12px;
  font-size: 0.86rem;
}

.process-section { padding: 74px 0; }

.journey {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.journey-card {
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(255,255,255,0.88);
  border-radius: 32px;
  padding: 26px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  min-height: 250px;
}

.journey-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  right: -48px;
  bottom: -58px;
  border-radius: 999px;
  background: var(--card-glow);
  opacity: 0.62;
}

.journey-number {
  width: 54px;
  height: 54px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: white;
  font-family: "Baloo 2", cursive;
  font-size: 1.55rem;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(38,50,75,0.09);
  margin-bottom: 20px;
}

.journey-card h3 {
  margin: 0 0 10px;
  font-family: "Baloo 2", cursive;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
}

.journey-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.app-section { padding: 28px 0 94px; }

.app-panel {
  background:
    radial-gradient(circle at 16% 20%, rgba(255,255,255,0.78), transparent 28%),
    linear-gradient(135deg, rgba(207,199,255,0.72), rgba(255,214,201,0.72) 52%, rgba(200,245,220,0.72));
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 42px;
  padding: 34px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 0.98fr 1.02fr;
  gap: 28px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.app-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,0.54);
  pointer-events: none;
}

.phone-mock {
  width: min(330px, 100%);
  margin: 0 auto;
  aspect-ratio: 0.54;
  border-radius: 42px;
  background: #29334d;
  padding: 14px;
  box-shadow: 0 35px 80px rgba(38,50,75,0.28);
  transform: rotate(-3deg);
  position: relative;
  z-index: 2;
}

.phone-screen {
  height: 100%;
  border-radius: 32px;
  background:
    radial-gradient(circle at 25% 12%, rgba(255,227,138,0.62), transparent 26%),
    linear-gradient(180deg, #fff8ef, #f5f7ff);
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.phone-notch {
  width: 92px;
  height: 24px;
  border-radius: 0 0 16px 16px;
  background: #29334d;
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  z-index: 3;
}

.mini-books {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin-top: 54px;
}

.mini-book {
  height: 124px;
  border-radius: 18px;
  box-shadow: 0 10px 20px rgba(38,50,75,0.09);
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  animation: miniFloat 4s ease-in-out infinite;
}

.mini-book:nth-child(2) { animation-delay: -1s; }
.mini-book:nth-child(3) { animation-delay: -2s; }
.mini-book:nth-child(4) { animation-delay: -3s; }

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

.app-copy {
  position: relative;
  z-index: 2;
}

.app-copy h2 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(2.2rem, 4.2vw, 4.6rem);
  line-height: 0.94;
  margin: 0 0 18px;
  letter-spacing: -0.055em;
}

.app-copy p {
  color: #4d5873;
  font-size: 1.1rem;
  font-weight: 750;
  line-height: 1.72;
  margin: 0 0 24px;
  max-width: 560px;
}

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.store-badge {
  background: rgba(38,50,75,0.94);
  color: white;
  border-radius: 18px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
  box-shadow: 0 16px 30px rgba(38,50,75,0.18);
  transition: 0.2s ease;
}

.store-badge:hover { transform: translateY(-2px); }
.store-badge span:first-child { font-size: 1.7rem; }

.store-badge small {
  display: block;
  color: rgba(255,255,255,0.72);
  font-weight: 800;
  line-height: 1;
}

.store-badge strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.1;
}

.footer {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto 24px;
  padding: 24px;
  border-radius: 30px;
  background: rgba(255,255,255,0.56);
  border: 1px solid rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-weight: 800;
}

.footer strong { color: var(--ink); }

/* Flipbook modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(38,50,75,0.46);
  backdrop-filter: blur(12px);
}

.modal.open { display: flex; }

.modal-card {
  width: min(1040px, 100%);
  max-height: min(850px, calc(100vh - 36px));
  overflow: auto;
  background:
    radial-gradient(circle at 12% 10%, rgba(255,227,138,0.46), transparent 30%),
    linear-gradient(135deg, #fff, #fff8ef);
  border-radius: 38px;
  box-shadow: 0 34px 110px rgba(20, 26, 45, 0.3);
  border: 1px solid rgba(255,255,255,0.82);
  position: relative;
  animation: popIn 0.24s ease both;
}

.flip-modal-card {
  padding: 26px;
}

@keyframes popIn {
  from { transform: translateY(18px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(38,50,75,0.12);
  font-weight: 950;
  z-index: 4;
}

.flip-modal-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 54px 18px 8px;
}

.flip-modal-header h2 {
  font-family: "Baloo 2", cursive;
  font-size: clamp(2rem, 4vw, 3.7rem);
  margin: 0 0 6px;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.flip-modal-header p {
  margin: 0;
  color: var(--muted);
  max-width: 650px;
  font-weight: 750;
  line-height: 1.55;
}

.flip-progress {
  flex: 0 0 auto;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(38,50,75,0.07);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 950;
  box-shadow: var(--shadow-soft);
}

.flipbook-shell {
  position: relative;
  min-height: 610px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 32px;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.86), transparent 40%),
    linear-gradient(135deg, rgba(207,199,255,0.22), rgba(191,232,255,0.22), rgba(255,214,201,0.22));
  border: 1px solid rgba(255,255,255,0.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.flipbook {
  width: 390px;
  height: 540px;
}

.flip-page {
  width: 390px;
  height: 540px;
  padding: 34px;
  border-radius: 18px;
  overflow: hidden;
  background: #fffaf1;
  box-shadow: inset 0 0 0 1px rgba(38,50,75,0.05);
  color: var(--ink);
  position: relative;
}

.flip-page::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 14px;
  pointer-events: none;
}

.flip-page.cover-page {
  display: grid;
  align-content: end;
  color: white;
  text-shadow: 0 4px 18px rgba(38,50,75,0.22);
}

.flip-page.cover-page .page-emoji {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-size: 7rem;
  filter: drop-shadow(0 16px 16px rgba(38,50,75,0.16));
}

.flip-page.cover-page h3 {
  font-size: 2.9rem;
  line-height: 0.9;
  margin: 0 0 8px;
}

.flip-page.cover-page .page-label {
  background: rgba(255,255,255,0.24);
  color: white;
}

.flip-page h3 {
  font-family: "Baloo 2", cursive;
  font-size: 2.25rem;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
  position: relative;
  z-index: 1;
}

.flip-page p {
  color: #4f5b74;
  font-size: 1.13rem;
  line-height: 1.68;
  font-weight: 800;
  margin: 0;
  position: relative;
  z-index: 1;
}

.page-label {
  display: inline-flex;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.72);
  border-radius: 999px;
  padding: 8px 12px;
  color: #6b5b95;
  font-weight: 950;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.page-art {
  position: absolute;
  right: -30px;
  bottom: -35px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: rgba(255,227,138,0.5);
}

.page-art::before {
  content: "✨";
  position: absolute;
  left: 42px;
  top: 34px;
  font-size: 3rem;
}

.flip-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 20px;
  border-radius: 32px;
  background: rgba(255,255,255,0.62);
  color: var(--muted);
  font-weight: 850;
  box-shadow: var(--shadow-soft);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .hero,
  .app-panel {
    grid-template-columns: 1fr;
  }

  .hero { min-height: auto; }
  .hero-stage { min-height: 560px; }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .journey { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    border-radius: 28px;
    flex-direction: column;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-actions {
    position: absolute;
    right: 14px;
    top: 14px;
  }

  .nav-actions .btn-secondary { display: none; }

  .hero h1 {
    font-size: clamp(3.3rem, 16vw, 5.4rem);
  }

  .section-heading,
  .flip-modal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .book-grid { grid-template-columns: repeat(2, 1fr); }
  .floating-card { display: none; }

  .flip-modal-card {
    padding: 18px;
  }

  .flip-modal-header {
    padding-right: 54px;
  }

  .flipbook-shell {
    min-height: 500px;
    padding: 14px;
  }

  .flipbook,
  .flip-page {
    width: 310px;
    height: 430px;
  }

  .flip-page {
    padding: 26px;
  }

  .flip-page.cover-page h3,
  .flip-page h3 {
    font-size: 1.95rem;
  }

  .flip-page p {
    font-size: 1rem;
    line-height: 1.55;
  }

  .flip-page.cover-page .page-emoji {
    font-size: 5.4rem;
  }
}

@media (max-width: 560px) {
  .book-grid { grid-template-columns: 1fr; }

  .hero-actions,
  .store-row,
  .book-actions,
  .flip-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  .store-badge {
    width: 100%;
  }

  .hero-stage { min-height: 460px; }
  .main-book { width: 82vw; }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .flipbook-shell {
    min-height: 445px;
    padding: 10px;
  }

  .flipbook,
  .flip-page {
    width: 275px;
    height: 382px;
  }

  .flip-page {
    padding: 22px;
  }

  .flip-page h3,
  .flip-page.cover-page h3 {
    font-size: 1.65rem;
  }

  .flip-page p {
    font-size: 0.92rem;
  }
}


/* Full-screen focused flipbook reader */
.modal.reader-fullscreen {
  padding: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 227, 138, 0.28), transparent 26%),
    radial-gradient(circle at 88% 10%, rgba(207, 199, 255, 0.28), transparent 28%),
    linear-gradient(135deg, #1f2941, #29334d 58%, #1f2941);
}

.modal.reader-fullscreen .flip-modal-card {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,255,255,0.14), transparent 42%),
    linear-gradient(135deg, #202942, #2e3856);
  border: 0;
}

.modal.reader-fullscreen .modal-close {
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.92);
}

.modal.reader-fullscreen .flip-modal-header {
  padding: 6px 58px 8px 8px;
  color: white;
}

.modal.reader-fullscreen .flip-modal-header .section-kicker {
  color: rgba(255,255,255,0.68);
}

.modal.reader-fullscreen .flip-modal-header h2 {
  color: white;
  font-size: clamp(1.3rem, 3vw, 2.4rem);
}

.modal.reader-fullscreen .flip-modal-header p {
  display: none;
}

.modal.reader-fullscreen .flip-progress {
  color: white;
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.16);
  box-shadow: none;
}

.modal.reader-fullscreen .flipbook-shell {
  min-height: 0;
  height: 100%;
  width: 100%;
  padding: 8px;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.modal.reader-fullscreen .flipbook {
  width: var(--reader-page-width, 390px);
  height: var(--reader-page-height, 540px);
}

.modal.reader-fullscreen .flip-page {
  width: var(--reader-page-width, 390px);
  height: var(--reader-page-height, 540px);
}

.modal.reader-fullscreen .flip-controls {
  margin-top: 0;
  padding: 8px 6px 4px;
}

.modal.reader-fullscreen .flip-controls .btn {
  padding: 11px 15px;
}

.modal.reader-fullscreen #fullscreenButton {
  background: rgba(255,255,255,0.9);
}

@media (orientation: landscape) and (max-height: 560px) {
  .modal.reader-fullscreen .flip-modal-header {
    display: none;
  }

  .modal.reader-fullscreen .flip-modal-card {
    grid-template-rows: 1fr auto;
  }

  .modal.reader-fullscreen .flip-controls {
    padding-bottom: 6px;
  }
}


/* Equal-height book cards */
.book-card {
  display: flex;
  flex-direction: column;
}

.book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-info h3 {
  min-height: 2.7em;
  display: flex;
  align-items: flex-start;
}

.book-meta {
  min-height: 32px;
}

.book-info p {
  min-height: 5.9em;
}

.book-actions {
  margin-top: auto;
  overflow: hidden;
}

.book-actions .btn {
  min-width: 0;
}

/* PDF preview pages inside the flipbook */
.pdf-page {
  padding: 0;
  background: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-page canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.pdf-loading {
  width: min(420px, 90vw);
  padding: 26px;
  border-radius: 26px;
  background: rgba(255,255,255,0.78);
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.upload-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .book-info h3,
  .book-info p {
    min-height: auto;
  }
}


/* Cleaner compact card buttons */
.book-actions {
  gap: 10px;
}

.book-actions .btn {
  font-size: 0.82rem;
  padding: 10px 10px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.book-actions .btn-secondary {
  flex: 0.9;
}

.book-actions .btn-primary {
  flex: 1;
}

@media (max-width: 560px) {
  .book-actions .btn {
    font-size: 0.9rem;
    padding: 12px 14px;
  }
}


/* Production label polish */
.section-kicker {
  color: #7a65b6;
}

.book-actions .btn {
  font-size: 0.78rem;
  padding: 10px 8px;
}

.book-actions .btn-secondary {
  flex: 1.08;
}

.book-actions .btn-primary {
  flex: 0.92;
}

.flip-progress {
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .book-actions .btn {
    font-size: 0.9rem;
    padding: 12px 14px;
  }
}


/* Production footer */
.site-footer {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto 24px;
  padding: 22px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 227, 138, 0.32), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(255,248,237,0.72));
  border: 1px solid rgba(255,255,255,0.86);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr auto auto;
  align-items: center;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(38,50,75,0.08);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-logo {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 28%, #fff 0 11%, transparent 12%),
    linear-gradient(135deg, var(--lavender), var(--pink) 55%, var(--sun));
  box-shadow: inset 0 -8px 18px rgba(255, 255, 255, 0.34), 0 12px 24px rgba(113, 98, 184, 0.18);
  transform: rotate(-4deg);
}

.footer-logo span {
  font-size: 26px;
  transform: rotate(4deg);
}

.footer-title {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 1.28rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.footer-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-links a {
  padding: 10px 12px;
  border-radius: 999px;
  color: #566078;
  font-weight: 900;
  transition: 0.2s ease;
}

.footer-links a:hover {
  color: var(--ink);
  background: rgba(207,199,255,0.24);
  transform: translateY(-1px);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-social a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(38,50,75,0.07);
  box-shadow: 0 12px 22px rgba(65,76,116,0.08);
  transition: 0.2s ease;
}

.footer-social a:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--sun), var(--pink), var(--lavender));
}

.footer-social svg {
  width: 22px;
  height: 22px;
  fill: var(--ink);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
}

@media (max-width: 820px) {
  .footer-inner {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .site-footer {
    padding: 18px;
  }

  .footer-links {
    width: 100%;
  }

  .footer-links a {
    padding-left: 0;
  }
}


/* Stronger Peek Inside pull factor */
.book-actions {
  gap: 10px;
}

.book-actions .btn {
  min-width: 0;
  white-space: nowrap;
  font-size: 0.76rem;
  padding: 10px 8px;
  letter-spacing: -0.01em;
}

.book-actions .btn-secondary {
  flex: 1.12;
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.92), transparent 30%),
    linear-gradient(135deg, #fff5cc, #ffd7e5 52%, #d9d4ff);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow:
    0 14px 26px rgba(248, 183, 207, 0.24),
    inset 0 1px 0 rgba(255,255,255,0.55);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.book-actions .btn-secondary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.55) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.65s ease;
}

.book-card:hover .book-actions .btn-secondary::after {
  transform: translateX(120%);
}

.book-actions .btn-secondary:hover {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.06);
}

.book-actions .btn-primary {
  flex: 0.88;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(38, 50, 75, 0.07);
  box-shadow: 0 12px 22px rgba(65, 76, 116, 0.08);
}

@media (max-width: 560px) {
  .book-actions .btn {
    font-size: 0.9rem;
    padding: 12px 14px;
  }
}


/* --- Heyzine-inspired upgrades: book hover flip + lighter reader controls --- */

/* Flip card system */
.book-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 430px;
  perspective: 1400px;
  overflow: visible;
}

.book-card:hover {
  transform: none;
  box-shadow: none;
}

.book-card-inner {
  position: relative;
  min-height: 430px;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.22, 0.78, 0.18, 1);
}

.book-card:hover .book-card-inner,
.book-card.is-flipped .book-card-inner,
.book-card:focus-within .book-card-inner {
  transform: rotateY(180deg);
}

.book-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 30px;
  padding: 14px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.book-card-face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 30% 10%, rgba(255,255,255,0.82), transparent 30%);
}

.book-card-front .book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card-front .book-info h3 {
  min-height: 2.7em;
  display: flex;
  align-items: flex-start;
}

.book-card-front .book-meta {
  min-height: 32px;
}

.book-card-front .book-info p {
  min-height: 5.9em;
}

.book-tease {
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
}

.book-tease-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.92), transparent 30%),
    linear-gradient(135deg, #fff5cc, #ffd7e5 52%, #d9d4ff);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow:
    0 14px 26px rgba(248, 183, 207, 0.24),
    inset 0 1px 0 rgba(255,255,255,0.55);
  font-size: 0.86rem;
  font-weight: 950;
  color: var(--ink);
}

.book-card-back {
  transform: rotateY(180deg);
  padding: 18px;
  color: white;
  text-align: center;
}

.book-card-back::before {
  background:
    radial-gradient(circle at 26% 18%, rgba(255,255,255,0.24), transparent 32%),
    linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
}

.book-card-back-inner {
  height: 100%;
  border-radius: 22px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,0.34);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.book-back-badge {
  align-self: center;
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.01em;
}

.book-back-emoji {
  font-size: 5rem;
  line-height: 1;
  margin: 8px 0 4px;
  filter: drop-shadow(0 12px 18px rgba(38,50,75,0.18));
}

.book-card-back h4 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 2rem;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.book-card-back p {
  margin: 0;
  color: rgba(255,255,255,0.92);
  font-size: 0.96rem;
  line-height: 1.55;
  font-weight: 800;
  max-width: 240px;
  align-self: center;
}

.book-actions-back {
  margin-top: 0;
  width: 100%;
}

.book-actions-back .btn {
  font-size: 0.82rem;
  padding: 11px 10px;
}

.book-actions-back .btn-secondary {
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(38,50,75,0.12);
}

.book-actions-back .btn-primary {
  background: rgba(38, 50, 75, 0.94);
  color: white;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 12px 24px rgba(38,50,75,0.16);
}

/* Lighter, less overbearing flipbook controls */
.modal-close {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 10px 20px rgba(38,50,75,0.1);
}

.flip-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  opacity: 0.92;
}

.toolbar-btn,
.toolbar-pill {
  border: 0;
  border-radius: 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.toolbar-btn {
  width: 44px;
  padding: 0;
  background: rgba(255,255,255,0.82);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(65,76,116,0.08);
}

.toolbar-btn:hover,
.toolbar-pill:hover {
  transform: translateY(-1px);
}

.toolbar-meta {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.72);
  color: var(--muted);
  box-shadow: 0 12px 24px rgba(65,76,116,0.06);
  font-size: 0.88rem;
  font-weight: 900;
}

.toolbar-pill {
  padding: 0 14px;
  background: var(--ink);
  color: white;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(38,50,75,0.14);
}

.modal.reader-fullscreen .flip-controls {
  margin-top: 8px;
}

.modal.reader-fullscreen .toolbar-btn,
.modal.reader-fullscreen .toolbar-meta {
  background: rgba(255,255,255,0.14);
  color: white;
  box-shadow: none;
}

.modal.reader-fullscreen .toolbar-pill {
  background: rgba(255,255,255,0.92);
  color: var(--ink);
  box-shadow: none;
}

/* Mobile: use tap-to-flip and keep the card stable */
@media (hover: none) {
  .book-card:hover .book-card-inner {
    transform: none;
  }
}

@media (max-width: 560px) {
  .book-card,
  .book-card-inner {
    min-height: 400px;
  }

  .book-card-face {
    padding: 12px;
  }

  .book-card-front .book-info h3,
  .book-card-front .book-info p {
    min-height: auto;
  }

  .book-back-emoji {
    font-size: 4.2rem;
  }

  .book-card-back h4 {
    font-size: 1.72rem;
  }

  .toolbar-meta {
    order: -1;
    width: 100%;
  }
}


/* Fix flipped-card CTA fit */
.book-card-back-inner {
  justify-content: space-between;
  gap: 10px;
  padding: 18px 14px 14px;
}

.book-back-badge {
  margin-bottom: 2px;
}

.book-back-emoji {
  font-size: 4.25rem;
  margin: 4px 0 0;
}

.book-card-back h4 {
  font-size: 1.72rem;
  margin: 0;
}

.book-card-back p {
  font-size: 0.88rem;
  line-height: 1.42;
  max-width: 220px;
}

.book-actions-back {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

.book-actions-back .btn {
  width: 100%;
  justify-content: center;
  font-size: 0.82rem;
  padding: 10px 12px;
  min-height: 42px;
}

.book-actions-back .btn-secondary,
.book-actions-back .btn-primary {
  flex: none;
}

@media (max-width: 1040px) {
  .book-card-back p {
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .book-card-back-inner {
    padding: 16px 12px 12px;
  }

  .book-back-emoji {
    font-size: 3.8rem;
  }

  .book-card-back h4 {
    font-size: 1.5rem;
  }

  .book-card-back p {
    font-size: 0.84rem;
    line-height: 1.36;
  }

  .book-actions-back .btn {
    font-size: 0.8rem;
    padding: 10px 10px;
  }
}


/* Floating cover text + cleaner back face */
.book-card,
.book-card-inner {
  min-height: 420px;
}

.book-card-front .book-cover {
  height: 244px;
}

.book-card-front .book-info {
  padding: 14px 6px 2px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card-front .book-info p {
  min-height: 6.1em;
  margin: 0 0 14px;
}

.book-card-front .book-info h3,
.book-card-front .book-meta {
  display: none;
}

.cover-title {
  opacity: 0.12;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.book-card:hover .cover-title,
.book-card.is-flipped .cover-title,
.book-card:focus-within .cover-title {
  opacity: 0;
  transform: translateY(16px);
}

.cover-floating-info {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.20);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 28px rgba(38,50,75,0.12);
  transform: translateY(0) scale(1);
  transition: transform 0.45s ease, background 0.45s ease, box-shadow 0.45s ease;
}

.book-card:hover .cover-floating-info,
.book-card.is-flipped .cover-floating-info,
.book-card:focus-within .cover-floating-info {
  transform: translateY(-4px) scale(1.01);
  background: rgba(255,255,255,0.24);
  box-shadow: 0 18px 34px rgba(38,50,75,0.16);
}

.cover-floating-info h3 {
  margin: 0 0 8px;
  color: white;
  font-family: "Baloo 2", cursive;
  font-size: 1.48rem;
  line-height: 0.94;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 3px 14px rgba(38,50,75,0.20);
}

.cover-floating-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cover-floating-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  color: #5f6782;
  font-size: 0.72rem;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(38,50,75,0.08);
}

/* Cleaner, more compact back face */
.book-card-back {
  padding: 16px;
}

.book-card-back-inner {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  align-items: stretch;
  padding: 16px 14px 14px;
}

.book-card-back-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.book-back-badge {
  margin: 0;
}

.book-back-emoji {
  font-size: 3.9rem;
  margin: 0;
}

.book-card-back h4 {
  margin: 0;
  font-size: 1.56rem;
  text-align: center;
}

.book-card-back p {
  margin: 0;
  max-width: 200px;
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: center;
}

.book-actions-back {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: end;
}

.book-actions-back .btn {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.book-actions-back .btn-secondary,
.book-actions-back .btn-primary {
  flex: none;
}

@media (max-width: 560px) {
  .book-card,
  .book-card-inner {
    min-height: 398px;
  }

  .book-card-front .book-cover {
    height: 220px;
  }

  .cover-floating-info {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px;
  }

  .cover-floating-info h3 {
    font-size: 1.34rem;
  }

  .cover-floating-tags span {
    font-size: 0.68rem;
    padding: 5px 9px;
  }

  .book-card-front .book-info p {
    min-height: auto;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .book-back-emoji {
    font-size: 3.4rem;
  }

  .book-card-back h4 {
    font-size: 1.42rem;
  }

  .book-card-back p {
    max-width: 100%;
    font-size: 0.8rem;
  }
}


/* Remove duplicated age/category info and support Coming Soon cards */
.cover-floating-tags {
  justify-content: flex-start;
}

.cover-floating-tags span {
  min-height: 28px;
  padding: 6px 12px;
}

.cover-status {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(38,50,75,0.82);
  color: white;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(38,50,75,0.16);
}

.cover-badge {
  z-index: 7;
}

.coming-tag {
  background: rgba(255,255,255,0.9) !important;
  color: #5c6278 !important;
}

.coming-soon-pill {
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.96), transparent 30%),
    linear-gradient(135deg, #e8f7e8, #fff3c9 52%, #ffdbe6) !important;
}

.coming-soon-card .book-card-back-top {
  gap: 10px;
}

.coming-soon-card .book-back-badge {
  background: rgba(255,255,255,0.24);
}

.book-card-back p {
  max-width: 190px;
}

.book-actions-back {
  align-content: end;
}

.book-actions-back .is-static {
  background: rgba(255,255,255,0.94);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(38,50,75,0.12);
  cursor: default;
}

.book-actions-back .is-static:hover {
  transform: none;
  filter: none;
}

@media (max-width: 560px) {
  .cover-status {
    left: 12px;
    top: 12px;
    font-size: 0.68rem;
    padding: 6px 10px;
  }
}


/* Uniform card layout for all titles, including Coming Soon */
.book-grid {
  align-items: stretch;
}

.book-card,
.book-card-inner {
  min-height: 420px;
  height: 100%;
}

.book-card-face {
  height: 100%;
}

.cover-status {
  display: none !important;
}

.book-card-front .book-cover {
  height: 238px;
}

.cover-floating-info {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.cover-floating-info h3 {
  min-height: 2.1em;
  display: flex;
  align-items: flex-end;
}

.cover-floating-tags {
  min-height: 30px;
}

.book-card-front .book-info {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 14px 6px 2px;
}

.book-card-front .book-info p {
  min-height: 5.8em;
  margin: 0;
}

.book-tease {
  margin-top: 0;
}

.book-tease-pill,
.coming-soon-pill {
  min-width: 118px;
  justify-content: center;
}

.book-card-back {
  padding: 16px;
}

.book-card-back-inner {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 16px 14px 14px;
}

.book-card-back-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 0;
}

.book-back-badge {
  margin: 0;
  min-width: 112px;
  justify-content: center;
}

.book-back-emoji {
  font-size: 3.8rem;
  margin: 0;
}

.book-card-back h4 {
  margin: 0;
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-align: center;
}

.book-card-back p {
  margin: 0;
  max-width: 190px;
  min-height: 2.7em;
  font-size: 0.84rem;
  line-height: 1.36;
  text-align: center;
}

.book-actions-back {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: end;
  margin-top: auto;
}

.book-actions-back .btn {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
  justify-content: center;
}

.book-actions-back .btn-secondary,
.book-actions-back .btn-primary {
  flex: none;
}

.coming-soon-card .book-tease-pill {
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.96), transparent 30%),
    linear-gradient(135deg, #e8f7e8, #fff3c9 52%, #ffdbe6) !important;
}

.coming-soon-card .book-back-badge {
  background: rgba(255,255,255,0.24);
}

.coming-soon-card .is-static {
  cursor: default;
}

.coming-soon-card .is-static:hover {
  transform: none;
  filter: none;
}

@media (max-width: 560px) {
  .book-card,
  .book-card-inner {
    min-height: 398px;
  }

  .book-card-front .book-cover {
    height: 220px;
  }

  .cover-floating-info {
    min-height: 104px;
  }

  .cover-floating-info h3 {
    font-size: 1.34rem;
  }

  .book-card-front .book-info p {
    min-height: auto;
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .book-back-emoji {
    font-size: 3.35rem;
  }

  .book-card-back h4 {
    font-size: 1.4rem;
  }

  .book-card-back p {
    max-width: 100%;
    min-height: auto;
    font-size: 0.8rem;
  }
}


/* Real uploaded book thumbnails */
.book-card,
.book-card-inner {
  min-height: 460px;
}

.book-card-front .book-cover.real-book-cover {
  height: auto;
  aspect-ratio: 1.414 / 1;
  padding: 0;
  border-radius: 24px;
  background: rgba(255,255,255,0.72);
  display: block;
  overflow: hidden;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: rgba(255,255,255,0.58);
}

.real-book-cover .cover-badge {
  right: 10px;
  top: 10px;
  z-index: 7;
}

.real-book-cover .cover-status {
  display: inline-flex !important;
  left: 10px;
  top: 10px;
}

.real-book-cover .cover-spine,
.real-book-cover .cover-title,
.real-book-cover .cover-floating-info,
.real-book-cover .cover-emoji {
  display: none !important;
}

.book-card-front .book-info {
  flex: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  padding: 14px 6px 2px;
}

.book-card-front .book-info h3 {
  display: flex !important;
  align-items: flex-start;
  min-height: 2.55em;
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.34rem;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.book-card-front .book-meta {
  display: flex !important;
  min-height: 30px;
  margin: 0;
}

.book-card-front .book-info p {
  min-height: 5.4em;
  margin: 0;
}

.book-tease {
  margin-top: 0;
  align-self: end;
}

.book-tease-pill,
.coming-soon-pill {
  min-width: 122px;
  justify-content: center;
}

.book-card-back-inner {
  grid-template-rows: 1fr auto;
}

@media (max-width: 560px) {
  .book-card,
  .book-card-inner {
    min-height: 430px;
  }

  .book-card-front .book-info h3,
  .book-card-front .book-info p {
    min-height: auto;
  }
}


/* Final production card alignment update
   - age/category pills below title
   - no overlay badges on thumbnails
   - coming soon appears only in the bottom CTA
   - back of card uses actual book thumbnail
*/
.real-book-cover .cover-badge,
.real-book-cover .cover-status,
.cover-status {
  display: none !important;
}

.book-card,
.book-card-inner {
  min-height: 468px;
}

.book-card-front .book-cover.real-book-cover {
  height: auto;
  aspect-ratio: 1.414 / 1;
  border-radius: 24px;
  padding: 0;
  overflow: hidden;
}

.book-cover-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: rgba(255,255,255,0.58);
}

.book-card-front .book-info {
  flex: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 9px;
  padding: 14px 6px 2px;
}

.book-card-front .book-info h3 {
  display: flex !important;
  align-items: flex-start;
  min-height: 2.55em;
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.34rem;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.book-card-front .book-meta {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
  margin: 0;
}

.book-card-front .book-meta .tag {
  font-size: 0.66rem;
  line-height: 1;
  padding: 5px 8px;
  min-height: 24px;
  border-radius: 999px;
  font-weight: 950;
}

.book-card-front .book-info p {
  min-height: 5.2em;
  margin: 0;
}

.book-tease {
  align-self: end;
  margin-top: 0;
}

.coming-soon-card .category-tag {
  display: inline-flex;
}

/* Back-side thumbnail layout */
.book-card-back-inner {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  padding: 14px;
}

.book-card-back-top {
  display: grid;
  grid-template-rows: auto auto auto;
  align-items: start;
  justify-items: center;
  gap: 9px;
  min-height: 0;
}

.book-back-badge,
.book-back-emoji {
  display: none !important;
}

.book-back-cover {
  width: 100%;
  max-width: 176px;
  aspect-ratio: 1.414 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 16px 26px rgba(38,50,75,0.14);
}

.book-back-cover-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.book-card-back h4 {
  min-height: 1.95em;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.42rem;
  line-height: 0.95;
  text-align: center;
}

.book-card-back p {
  min-height: 2.5em;
  max-width: 200px;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.34;
  text-align: center;
}

.book-actions-back {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: end;
  margin-top: auto;
}

.book-actions-back .btn {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
  justify-content: center;
}

.coming-soon-card .book-actions-back {
  grid-template-columns: 1fr;
}

.coming-soon-card .book-actions-back .btn {
  min-height: 42px;
}

@media (max-width: 560px) {
  .book-card,
  .book-card-inner {
    min-height: 438px;
  }

  .book-card-front .book-info h3,
  .book-card-front .book-info p {
    min-height: auto;
  }

  .book-card-front .book-meta .tag {
    font-size: 0.64rem;
    padding: 5px 8px;
  }

  .book-back-cover {
    max-width: 158px;
  }

  .book-card-back h4 {
    font-size: 1.28rem;
  }

  .book-card-back p {
    min-height: auto;
    font-size: 0.78rem;
  }
}


/* Lift-card interaction instead of flip cards */
.book-grid {
  align-items: stretch;
}

.book-card {
  min-height: 478px;
  perspective: none !important;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.book-card:hover,
.book-card.is-lifted {
  transform: none;
  box-shadow: none;
}

.book-card-inner {
  position: relative;
  min-height: 478px;
  height: 100%;
  transform: none !important;
  transform-style: flat !important;
  transition: transform 0.24s ease, filter 0.24s ease;
}

.book-card:hover .book-card-inner,
.book-card:focus-within .book-card-inner,
.book-card.is-lifted .book-card-inner {
  transform: translateY(-10px) scale(1.01) !important;
}

.book-card-face {
  position: relative !important;
  inset: auto !important;
  height: 100%;
  backface-visibility: visible !important;
  -webkit-backface-visibility: visible !important;
  transform: none !important;
}

.book-card-back {
  display: none !important;
}

.book-card-front {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 30px;
  background: rgba(255,255,255,0.76);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow: var(--shadow-soft);
}

.book-card-front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 30px;
  background: radial-gradient(circle at 30% 10%, rgba(255,255,255,0.82), transparent 30%);
}

.book-card:hover .book-card-front,
.book-card:focus-within .book-card-front,
.book-card.is-lifted .book-card-front {
  box-shadow: var(--shadow);
}

.book-card-front .book-cover.real-book-cover {
  height: auto;
  aspect-ratio: 1.414 / 1;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(38,50,75,0.08);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.book-card:hover .book-cover.real-book-cover,
.book-card:focus-within .book-cover.real-book-cover,
.book-card.is-lifted .book-cover.real-book-cover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(38,50,75,0.12);
}

.real-book-cover .cover-badge,
.real-book-cover .cover-status,
.cover-status,
.book-card-back,
.cover-floating-info,
.cover-title,
.cover-spine {
  display: none !important;
}

.book-card-front .book-info {
  flex: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 9px;
  padding: 14px 6px 2px;
}

.book-card-front .book-info h3 {
  display: flex !important;
  align-items: flex-start;
  min-height: 2.55em;
  margin: 0;
  font-family: "Baloo 2", cursive;
  font-size: 1.34rem;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.book-card-front .book-meta {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
  margin: 0;
}

.book-card-front .book-meta .tag {
  font-size: 0.66rem;
  line-height: 1;
  padding: 5px 8px;
  min-height: 24px;
  border-radius: 999px;
  font-weight: 950;
}

.book-card-front .book-info p {
  min-height: 5.2em;
  margin: 0;
}

.book-actions-front {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-content: end;
  margin-top: auto;
}

.book-actions-front .btn {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
  justify-content: center;
}

.book-actions-front .btn-secondary {
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.92), transparent 30%),
    linear-gradient(135deg, #fff5cc, #ffd7e5 52%, #d9d4ff);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow:
    0 14px 26px rgba(248, 183, 207, 0.20),
    inset 0 1px 0 rgba(255,255,255,0.55);
  color: var(--ink);
}

.book-actions-front .btn-primary {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(38,50,75,0.07);
  box-shadow: 0 12px 22px rgba(65,76,116,0.08);
  color: var(--ink);
}

.coming-soon-card .book-actions-front .btn-secondary.is-static {
  background:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,0.96), transparent 30%),
    linear-gradient(135deg, #e8f7e8, #fff3c9 52%, #ffdbe6) !important;
  cursor: default;
}

.coming-soon-card .book-actions-front .btn-secondary.is-static:hover {
  transform: none;
  filter: none;
}

@media (max-width: 560px) {
  .book-card,
  .book-card-inner {
    min-height: 438px;
  }

  .book-card-front .book-info h3,
  .book-card-front .book-info p {
    min-height: auto;
  }

  .book-card-front .book-meta .tag {
    font-size: 0.64rem;
    padding: 5px 8px;
  }

  .book-actions-front .btn {
    font-size: 0.8rem;
  }
}


/* PDF first-five-pages preview with locked/blurred remaining pages */
.pdf-page {
  padding: 0;
  background: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pdf-page canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}

.locked-pdf-page canvas {
  filter: blur(7px) grayscale(0.35);
  opacity: 0.38;
  transform: scale(1.015);
}

.locked-pdf-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.42), transparent 36%),
    linear-gradient(135deg, rgba(38,50,75,0.28), rgba(255,255,255,0.5));
  pointer-events: none;
}

.locked-page-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(78%, 290px);
  transform: translate(-50%, -50%);
  padding: 22px 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow: 0 22px 46px rgba(38,50,75,0.18);
  text-align: center;
  backdrop-filter: blur(12px);
}

.locked-page-overlay .lock-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--sun), var(--pink));
  box-shadow: 0 12px 24px rgba(248,183,207,0.22);
}

.locked-page-overlay strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Baloo 2", cursive;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink);
}

.locked-page-overlay span {
  display: block;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.38;
}

.pdf-unlock-page {
  background: linear-gradient(135deg, #26324b, #6d67c8) !important;
}

.pdf-loading {
  width: min(420px, 90vw);
  padding: 26px;
  border-radius: 26px;
  background: rgba(255,255,255,0.78);
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  box-shadow: var(--shadow-soft);
}


/* True PDF page viewer sizing
   The flipbook page now follows the actual PDF page aspect ratio.
   The canvas fills the page exactly instead of being squeezed into a fixed storybook ratio.
*/
.flipbook.pdf-active,
.flipbook.pdf-active .flip-page,
.flipbook.pdf-active .pdf-page {
  width: var(--reader-page-width) !important;
  height: var(--reader-page-height) !important;
}

.pdf-page {
  padding: 0 !important;
  background: #ffffff !important;
  display: block !important;
  overflow: hidden !important;
}

.pdf-page canvas {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: fill !important;
  background: #fff;
}

.flipbook-shell {
  overflow: hidden;
}

.modal.reader-fullscreen .flipbook-shell {
  align-items: center;
  justify-content: center;
}


/* Reload-safe PDF viewer tweaks */
.flipbook-shell .pdf-loading {
  margin: auto;
}

.pdf-page canvas {
  image-rendering: auto;
  transform: translateZ(0);
}

.flipbook.pdf-active {
  min-width: var(--reader-page-width);
  min-height: var(--reader-page-height);
}


/* Correct page counter display in all reader toolbars */
.flip-progress-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* Top reader counter removed; bottom toolbar counter is the single source of truth */
.flip-modal-header .flip-progress,
.flip-modal-header .flip-progress-count {
  display: none !important;
}


/* JPG/Web image based book preview pages */
.flipbook.image-active,
.flipbook.image-active .flip-page,
.flipbook.image-active .image-page {
  width: var(--reader-page-width) !important;
  height: var(--reader-page-height) !important;
}

.image-page {
  padding: 0 !important;
  background: #ffffff !important;
  display: block !important;
  overflow: hidden !important;
  position: relative;
}

.image-page img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: fill !important;
  background: #fff;
}

.locked-image-page img {
  filter: blur(7px) grayscale(0.35);
  opacity: 0.38;
  transform: scale(1.015);
}

.locked-image-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.42), transparent 36%),
    linear-gradient(135deg, rgba(38,50,75,0.28), rgba(255,255,255,0.5));
  pointer-events: none;
}

.image-active .locked-page-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(78%, 290px);
  transform: translate(-50%, -50%);
  padding: 22px 18px;
  border-radius: 24px;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow: 0 22px 46px rgba(38,50,75,0.18);
  text-align: center;
  backdrop-filter: blur(12px);
}

.image-active .locked-page-overlay .lock-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--sun), var(--pink));
  box-shadow: 0 12px 24px rgba(248,183,207,0.22);
}

.image-active .locked-page-overlay strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Baloo 2", cursive;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--ink);
}

.image-active .locked-page-overlay span {
  display: block;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.38;
}


/* Brand logo image */
.brand-mark img,
.footer-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.footer-logo img {
  width: 28px;
  height: 28px;
}


/* Integrated generated mockups into the original slanted hero and app layouts */
.main-book {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0) 34%),
    linear-gradient(155deg, #8990ff, #ffd1e2 48%, #ffe79b);
}

.hero-stage-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 20px;
  filter: saturate(1.02);
}

.book-art,
.book-title-cover {
  display: none !important;
}

.phone-screen-image-wrap {
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background:
    radial-gradient(circle at 25% 12%, rgba(255,227,138,0.62), transparent 26%),
    linear-gradient(180deg, #fff8ef, #f5f7ff);
}

.phone-screen-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  border-radius: 32px;
}

.brand-title,
.brand-subtitle,
.mini-books,
.mini-book {
  display: none !important;
}

@media (max-width: 720px) {
  .hero-stage-image {
    object-position: center;
  }

  .phone-screen-image {
    object-position: center top;
  }
}


/* Replace the original artwork with the generated mockups directly */
.main-book.mockup-only {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.main-book.mockup-only .hero-stage-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
  filter: drop-shadow(0 36px 72px rgba(82, 80, 159, 0.28));
}

.phone-mock.mockup-only {
  width: min(360px, 100%);
  margin: 0 auto;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  position: relative;
  z-index: 2;
}

.phone-mock.mockup-only .app-mockup-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 35px 80px rgba(38,50,75,0.28));
}

.phone-mock.mockup-only .phone-notch,
.phone-mock.mockup-only .phone-screen,
.phone-screen-image-wrap,
.phone-screen-image,
.brand-title,
.brand-subtitle,
.mini-books,
.mini-book {
  display: none !important;
}


/* Cleaned mockup crops to remove extra image borders/background clutter */
.main-book.mockup-only {
  width: min(520px, 100%);
  margin-inline: auto;
}

.main-book.mockup-only .hero-stage-image {
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 22px;
}

.phone-mock.mockup-only {
  width: min(340px, 100%);
}

.phone-mock.mockup-only .app-mockup-image {
  object-fit: contain !important;
  object-position: center top !important;
  border-radius: 34px;
}


/* Mockup polish pass: cleaner hero visual + proper full phone presentation */
.story-orbit {
  display: grid;
  place-items: center;
  width: 100%;
}

.main-book.mockup-only {
  width: min(640px, 100%);
  height: auto;
  aspect-ratio: 1304 / 1206;
  margin-inline: auto;
  padding: 0;
  border-radius: 34px;
  overflow: hidden !important;
  background: rgba(255,255,255,0.42) !important;
  border: 1px solid rgba(255,255,255,0.72) !important;
  box-shadow: 0 30px 70px rgba(82, 80, 159, 0.16) !important;
}

.main-book.mockup-only .hero-stage-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 34px !important;
  filter: none !important;
}

.phone-mock.mockup-only {
  width: min(355px, 100%);
  margin: 0 auto;
  position: relative;
  padding: 14px;
  border-radius: 42px !important;
  background: linear-gradient(180deg, #2f3d63, #24314d) !important;
  box-shadow: 0 28px 60px rgba(38,50,75,0.22) !important;
  overflow: visible !important;
  transform: rotate(-4deg);
}

.phone-mock.mockup-only::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 24px;
  border-radius: 0 0 18px 18px;
  background: #24314d;
  z-index: 3;
}

.phone-mock.mockup-only .app-mockup-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain !important;
  object-position: center top !important;
  border-radius: 30px !important;
  filter: none !important;
  background: #fffdf7;
}

.app-copy {
  max-width: 540px;
}

@media (max-width: 900px) {
  .phone-mock.mockup-only {
    transform: none;
  }

  .main-book.mockup-only {
    width: min(560px, 100%);
  }
}

@media (max-width: 720px) {
  .main-book.mockup-only {
    width: 100%;
    border-radius: 24px;
  }

  .main-book.mockup-only .hero-stage-image {
    border-radius: 24px !important;
  }

  .phone-mock.mockup-only {
    width: min(310px, 100%);
  }
}


/* Fix brand text visibility in navbar */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  text-decoration: none;
}

.brand-text {
  display: grid !important;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  display: block !important;
  color: var(--ink);
  font-family: "Baloo 2", cursive;
  font-size: 1.32rem;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text span {
  display: block !important;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

/* Fix app section phone sizing and layout */
.app-showcase {
  align-items: center !important;
  grid-template-columns: minmax(280px, 400px) minmax(320px, 1fr) !important;
  gap: 38px !important;
}

.phone-mock.mockup-only {
  width: min(300px, 100%) !important;
  max-width: 300px !important;
  padding: 12px !important;
  border-radius: 38px !important;
  margin: 0 auto !important;
  overflow: visible !important;
  transform: rotate(-3deg) !important;
}

.phone-mock.mockup-only::before {
  width: 96px !important;
  height: 20px !important;
  top: 10px !important;
}

.phone-mock.mockup-only .app-mockup-image {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center top !important;
  border-radius: 28px !important;
}

.app-copy {
  max-width: 560px !important;
}

@media (max-width: 1100px) {
  .app-showcase {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .phone-mock.mockup-only {
    transform: none !important;
  }
}

@media (max-width: 760px) {
  .brand-text span {
    display: none !important;
  }

  .brand-text strong {
    font-size: 1.08rem;
  }

  .phone-mock.mockup-only {
    width: min(280px, 100%) !important;
    max-width: 280px !important;
  }
}


/* HARD FIX: replace generated phone image with a real responsive app mockup */
.app-panel {
  grid-template-columns: minmax(280px, 410px) 1fr !important;
  gap: 44px !important;
  align-items: center !important;
}

.phone-mock.real-phone-mock {
  width: min(360px, 100%) !important;
  aspect-ratio: 0.54 !important;
  margin: 0 auto !important;
  padding: 14px !important;
  border-radius: 44px !important;
  background: linear-gradient(180deg, #2f3d63, #202b45) !important;
  box-shadow: 0 34px 76px rgba(38,50,75,0.24) !important;
  transform: rotate(-3deg) !important;
  position: relative !important;
  overflow: visible !important;
}

.phone-mock.real-phone-mock .phone-notch {
  display: block !important;
  position: absolute !important;
  top: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 118px !important;
  height: 24px !important;
  border-radius: 0 0 18px 18px !important;
  background: #202b45 !important;
  z-index: 5 !important;
}

.real-phone-screen {
  height: 100% !important;
  width: 100% !important;
  border-radius: 34px !important;
  background:
    radial-gradient(circle at 22% 10%, rgba(255,227,138,0.42), transparent 28%),
    linear-gradient(180deg, #fffaf1, #ffffff 48%, #fff7fb) !important;
  overflow: hidden !important;
  padding: 36px 18px 74px !important;
  position: relative !important;
}

.app-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.app-preview-title {
  font-family: "Baloo 2", cursive;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  color: var(--ink);
}

.app-preview-subtitle {
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  line-height: 1.1;
  color: #697490;
  font-weight: 900;
}

.app-preview-heart {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff0f6;
  color: #d982a1;
  font-size: 1.1rem;
  box-shadow: 0 10px 20px rgba(217,130,161,0.12);
}

.app-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.app-preview-card {
  position: relative;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 12px 24px rgba(38,50,75,0.08);
  border: 1px solid rgba(38,50,75,0.04);
  min-width: 0;
}

.app-preview-card img {
  width: 100%;
  aspect-ratio: 1.26 / 1;
  object-fit: cover;
  object-position: center top;
  border-radius: 13px;
  display: block;
}

.app-preview-card strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1.12;
  font-weight: 900;
}

.app-preview-card span {
  display: inline-flex;
  margin-top: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #8f70ee, #c5a5ff);
  color: white;
  font-size: 0.62rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.app-preview-card.coming-card {
  border-color: rgba(143,112,238,0.28);
}

.app-preview-nav {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 10px 8px;
  border-radius: 22px;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 -2px 0 rgba(38,50,75,0.03), 0 14px 28px rgba(38,50,75,0.08);
}

.app-preview-nav div {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #9a9cac;
  font-weight: 800;
  font-size: 0.62rem;
}

.app-preview-nav span {
  font-size: 1rem;
  line-height: 1;
}

.app-preview-nav .active {
  color: #7b62df;
}

.phone-mock.mockup-only,
.phone-screen-image-wrap,
.phone-screen-image,
.app-mockup-image {
  display: none !important;
}

@media (max-width: 980px) {
  .app-panel {
    grid-template-columns: 1fr !important;
  }

  .phone-mock.real-phone-mock {
    transform: none !important;
    width: min(340px, 100%) !important;
  }
}

@media (max-width: 560px) {
  .phone-mock.real-phone-mock {
    width: min(310px, 100%) !important;
  }

  .real-phone-screen {
    padding: 34px 14px 72px !important;
  }

  .app-preview-grid {
    gap: 10px;
  }

  .app-preview-card {
    padding: 7px;
  }
}


/* Clean hero visual using real book covers instead of an AI collage */
.clean-story-orbit {
  display: grid;
  place-items: center;
  width: 100%;
}

.clean-hero-frame {
  position: relative;
  width: min(620px, 100%);
  aspect-ratio: 1 / 1.04;
  border-radius: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 72% 22%, rgba(255, 240, 175, 0.85), transparent 15%),
    radial-gradient(circle at 18% 78%, rgba(206, 241, 224, 0.72), transparent 18%),
    linear-gradient(135deg, rgba(190, 186, 255, 0.92), rgba(248, 217, 230, 0.92) 54%, rgba(233, 243, 255, 0.92));
  border: 1px solid rgba(255,255,255,0.78);
  box-shadow: 0 26px 64px rgba(90, 82, 152, 0.16);
}

.clean-hero-frame::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.38);
  pointer-events: none;
}

.clean-hero-frame::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 24px;
  bottom: 24px;
  width: 14px;
  background: rgba(86, 90, 122, 0.16);
  border-radius: 10px;
  transform: skewY(-8deg);
}

.hero-cover-stack {
  position: absolute;
  inset: 42px 44px 42px 60px;
}

.hero-cover {
  position: absolute;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 36px rgba(38,50,75,0.16);
  border: 1px solid rgba(255,255,255,0.72);
}

.hero-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.hero-cover-large {
  width: 40%;
  height: 40%;
}

.hero-cover-medium {
  width: 33%;
  height: 31%;
}

.hero-cover-small {
  width: 25%;
  height: 26%;
}

.hero-cover-a {
  left: 23%;
  top: 0;
  z-index: 3;
  transform: rotate(-1deg);
}

.hero-cover-b {
  left: 0;
  top: 37%;
  z-index: 3;
  transform: rotate(-1.5deg);
}

.hero-cover-c {
  left: 40%;
  top: 38%;
  z-index: 3;
  transform: rotate(0.8deg);
}

.hero-cover-d {
  left: 2%;
  bottom: 4%;
  z-index: 2;
  transform: rotate(-2deg);
}

.hero-cover-e {
  left: 30%;
  bottom: 2%;
  z-index: 2;
  transform: rotate(1.5deg);
}

.hero-cover-f {
  right: 1%;
  bottom: 10%;
  z-index: 2;
  transform: rotate(2deg);
}

.hero-coming-pill {
  position: absolute;
  right: 7%;
  bottom: 32%;
  z-index: 4;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(143,112,238,0.95), rgba(196,169,255,0.95));
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(143,112,238,0.18);
  letter-spacing: 0.02em;
}

.main-book.mockup-only,
.hero-stage-image,
.book-art,
.book-title-cover {
  display: none !important;
}

@media (max-width: 900px) {
  .clean-hero-frame {
    width: min(540px, 100%);
  }

  .hero-cover-stack {
    inset: 34px 30px 34px 46px;
  }
}

@media (max-width: 680px) {
  .clean-hero-frame {
    aspect-ratio: 1 / 1.08;
    border-radius: 28px;
  }

  .hero-cover-stack {
    inset: 28px 18px 28px 36px;
  }

  .hero-cover {
    border-radius: 14px;
  }

  .hero-cover-large {
    width: 44%;
    height: 36%;
  }

  .hero-cover-medium {
    width: 35%;
    height: 28%;
  }

  .hero-cover-small {
    width: 27%;
    height: 22%;
  }

  .hero-coming-pill {
    font-size: 0.65rem;
    padding: 7px 10px;
  }
}

@media (max-width: 520px) {
  .clean-hero-frame::after {
    width: 10px;
    left: 14px;
  }

  .hero-cover-stack {
    inset: 24px 16px 24px 28px;
  }
}
