/* ===========================================================
   SAFARI SPLASH — Brand Design System
   Colors pulled directly from the book cover for instant
   shelf-to-screen recognition.
=========================================================== */

:root{
  --jungle-deep:   #1B5433;
  --jungle:        #2B7A4A;
  --jungle-light:  #3E9C63;
  --sky:           #56BFD6;
  --sky-deep:      #2797B2;
  --sun:           #FAC72B;
  --sun-deep:      #E8AE0E;
  --orange:        #F08A28;
  --orange-deep:   #C46614;
  --purple:        #8B6FB3;
  --cream:         #FFFBF0;
  --white:         #FFFFFF;
  --ink:           #212824;
  --ink-soft:      #4B564F;
  --line:          #E7E1D2;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(27,84,51,0.10);
  --shadow-md: 0 8px 24px rgba(27,84,51,0.16);
  --shadow-lg: 0 16px 40px rgba(27,84,51,0.22);

  --font-display: 'Baloo 2', 'Fredoka', 'Poppins', system-ui, sans-serif;
  --font-body: 'Nunito', 'Poppins', system-ui, sans-serif;

  --container: 1180px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--cream);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,h4{
  font-family:var(--font-display);
  line-height:1.15;
  margin:0 0 .5em;
  color:var(--jungle-deep);
}
h1{ font-size:clamp(2.1rem,6vw,3.6rem); }
h2{ font-size:clamp(1.7rem,4.5vw,2.6rem); }
h3{ font-size:clamp(1.2rem,3vw,1.5rem); }
p{ margin:0 0 1em; }
.container{
  max-width:var(--container);
  margin:0 auto;
  padding:0 20px;
}
.section{ padding:64px 0; }
.section--tight{ padding:40px 0; }
@media(min-width:768px){
  .section{ padding:96px 0; }
}

.eyebrow{
  display:inline-block;
  font-family:var(--font-display);
  font-weight:700;
  font-size:.8rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--orange-deep);
  background:#FFF1DC;
  padding:6px 16px;
  border-radius:var(--radius-pill);
  margin-bottom:14px;
}
.eyebrow--sky{ color:var(--sky-deep); background:#E3F6FA; }
.eyebrow--jungle{ color:var(--jungle-deep); background:#E4F3E9; }

.center{ text-align:center; }
.lede{ font-size:1.15rem; color:var(--ink-soft); max-width:640px; }
.center .lede{ margin-left:auto; margin-right:auto; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-family:var(--font-display);
  font-weight:700;
  font-size:1.05rem;
  padding:16px 32px;
  border-radius:var(--radius-pill);
  border:none;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow:var(--shadow-sm);
}
.btn:hover{ transform:translateY(-3px) scale(1.02); box-shadow:var(--shadow-md); }
.btn:active{ transform:translateY(0) scale(.98); }
.btn--primary{ background:var(--sun); color:var(--jungle-deep); }
.btn--primary:hover{ background:var(--sun-deep); }
.btn--outline{ background:transparent; color:var(--white); border:2px solid var(--white); box-shadow:none; }
.btn--outline:hover{ background:rgba(255,255,255,.15); }
.btn--jungle{ background:var(--jungle); color:var(--white); }
.btn--jungle:hover{ background:var(--jungle-deep); }
.btn--sm{ padding:11px 22px; font-size:.92rem; }
.btn--block{ width:100%; }

/* ---------- Header / Nav ---------- */
.site-header{
  position:sticky; top:0; z-index:100;
  background:var(--cream);
  border-bottom:1px solid var(--line);
}
.nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
}
.nav__logo{
  display:flex; align-items:center; gap:8px;
  font-family:var(--font-display); font-weight:800; font-size:1.2rem;
  color:var(--jungle-deep);
  white-space:nowrap; flex-shrink:0;
}
.nav__logo .dot{ color:var(--orange); }
.nav__links{
  display:none;
  align-items:center;
  gap:18px;
  font-family:var(--font-display);
  font-weight:600;
  font-size:.88rem;
  flex-shrink:1;
  min-width:0;
}
.nav__links a{
  color:var(--ink); padding:6px 1px; border-bottom:3px solid transparent;
  transition:border-color .15s, color .15s;
  white-space:nowrap;
}
.nav__links a:hover, .nav__links a.active{ color:var(--jungle); border-color:var(--sun); }
.nav__cta{ display:none; white-space:nowrap; flex-shrink:0; }
.nav__toggle{
  display:flex; align-items:center; justify-content:center;
  width:44px; height:44px; border-radius:var(--radius-sm);
  background:var(--jungle); color:var(--white); border:none; cursor:pointer;
  font-size:1.3rem;
  flex-shrink:0;
}
@media(min-width:1220px){
  .nav__links{ display:flex; gap:24px; font-size:.98rem; }
  .nav__cta{ display:inline-flex; }
  .nav__toggle{ display:none; }
}
.nav__mobile{
  display:none;
  flex-direction:column;
  gap:4px;
  padding:12px 0 20px;
  border-top:1px solid var(--line);
}
.nav__mobile.open{ display:flex; }
.nav__mobile a{
  padding:12px 8px; font-family:var(--font-display); font-weight:600;
  border-radius:var(--radius-sm);
}
.nav__mobile a:hover{ background:#EFEAD8; }

/* ---------- Hero ---------- */
.hero{
  background:linear-gradient(180deg, var(--sky) 0%, var(--jungle-light) 60%, var(--jungle-deep) 100%);
  position:relative;
  overflow:hidden;
  color:var(--white);
  padding:56px 0 40px;
}
.hero::before, .hero::after{
  content:"";
  position:absolute;
  border-radius:50%;
  background:rgba(255,255,255,.12);
}
.hero::before{ width:260px; height:260px; top:-80px; left:-60px; }
.hero::after{ width:180px; height:180px; bottom:-60px; right:-40px; background:rgba(250,199,43,.18); }
.hero .container{
  display:grid;
  gap:36px;
  position:relative;
  z-index:2;
}
.hero__copy h1{ color:var(--white); }
.hero__copy .lede{ color:rgba(255,255,255,.92); max-width:520px; }
.hero__badges{
  display:flex; flex-wrap:wrap; gap:10px; margin:20px 0 28px;
}
.hero__badge{
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.35);
  padding:7px 14px; border-radius:var(--radius-pill);
  font-size:.85rem; font-weight:700; font-family:var(--font-display);
  display:flex; align-items:center; gap:6px;
}
.hero__ctas{ display:flex; flex-wrap:wrap; gap:14px; }
.hero__art{ position:relative; }
.hero__cover{
  max-width:320px; margin:0 auto;
  border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg);
  transform:rotate(-3deg);
  animation:float 5s ease-in-out infinite;
}
@keyframes float{
  0%,100%{ transform:rotate(-3deg) translateY(0); }
  50%{ transform:rotate(-1deg) translateY(-14px); }
}
.hero__star{
  position:absolute;
  font-size:1.8rem;
  animation:spin-wiggle 4s ease-in-out infinite;
}
@keyframes spin-wiggle{
  0%,100%{ transform:rotate(0deg) scale(1); }
  50%{ transform:rotate(18deg) scale(1.15); }
}
@media(min-width:860px){
  .hero{ padding:88px 0 70px; }
  .hero .container{ grid-template-columns:1.1fr .9fr; align-items:center; }
}

/* ---------- Trust strip ---------- */
.trust-strip{
  background:var(--jungle-deep);
  color:var(--white);
  padding:16px 0;
}
.trust-strip ul{
  display:flex; flex-wrap:wrap; justify-content:center; gap:28px;
  font-family:var(--font-display); font-weight:600; font-size:.85rem;
}
.trust-strip li{ display:flex; align-items:center; gap:8px; opacity:.95; }

/* ---------- Cards / grids ---------- */
.grid{ display:grid; gap:24px; }
.grid--2{ grid-template-columns:1fr; }
.grid--3{ grid-template-columns:1fr; }
.grid--4{ grid-template-columns:repeat(2,1fr); }
@media(min-width:640px){
  .grid--2{ grid-template-columns:1fr 1fr; }
  .grid--4{ grid-template-columns:repeat(4,1fr); }
}
@media(min-width:860px){
  .grid--3{ grid-template-columns:repeat(3,1fr); }
}

.card{
  background:var(--white);
  border-radius:var(--radius-md);
  padding:28px;
  box-shadow:var(--shadow-sm);
  transition:transform .2s ease, box-shadow .2s ease;
}
.card:hover{ transform:translateY(-6px); box-shadow:var(--shadow-md); }
.card__icon{
  width:56px; height:56px; border-radius:16px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.6rem; margin-bottom:16px;
  background:#E4F3E9;
}

.animal-card{
  background:var(--white);
  border-radius:var(--radius-md);
  overflow:hidden;
  box-shadow:var(--shadow-sm);
  transition:transform .25s ease, box-shadow .25s ease;
  text-align:center;
}
.animal-card:hover{ transform:translateY(-8px) rotate(-1deg); box-shadow:var(--shadow-md); }
.animal-card img{ width:100%; aspect-ratio:1/1; object-fit:cover; }
.animal-card__name{
  font-family:var(--font-display); font-weight:700; padding:14px 10px 18px;
  color:var(--jungle-deep);
}

/* ---------- Sections with alt background ---------- */
.section--sand{ background:#FFF6E4; }
.section--sky{ background:linear-gradient(180deg,#EAF9FC,var(--cream)); }
.section--jungle{
  background:var(--jungle-deep);
  color:var(--white);
}
.section--jungle h2, .section--jungle h3{ color:var(--white); }

/* ---------- Book preview carousel ---------- */
.preview{
  display:flex; gap:16px; overflow-x:auto; padding:10px 4px 22px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}
.preview::-webkit-scrollbar{ height:8px; }
.preview::-webkit-scrollbar-thumb{ background:var(--jungle-light); border-radius:8px; }
.preview img{
  scroll-snap-align:center;
  width:78vw; max-width:320px; flex:0 0 auto;
  border-radius:var(--radius-md);
  box-shadow:var(--shadow-md);
  border:6px solid var(--white);
}

/* ---------- Testimonials ---------- */
.testimonial{
  background:var(--white); border-radius:var(--radius-md);
  padding:26px; box-shadow:var(--shadow-sm);
  height:100%;
}
.testimonial__stars{ color:var(--sun-deep); font-size:1.1rem; margin-bottom:10px; letter-spacing:2px; }
.testimonial__quote{ font-style:italic; color:var(--ink-soft); margin-bottom:16px; }
.testimonial__by{ font-family:var(--font-display); font-weight:700; font-size:.9rem; color:var(--jungle-deep); }

/* ---------- FAQ accordion ---------- */
.faq-item{
  background:var(--white);
  border-radius:var(--radius-md);
  margin-bottom:14px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.faq-item__q{
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 22px; cursor:pointer;
  font-family:var(--font-display); font-weight:700; color:var(--jungle-deep);
}
.faq-item__q .plus{ transition:transform .2s ease; font-size:1.4rem; color:var(--orange); }
.faq-item.open .plus{ transform:rotate(45deg); }
.faq-item__a{
  max-height:0; overflow:hidden; transition:max-height .25s ease;
  padding:0 22px; color:var(--ink-soft);
}
.faq-item.open .faq-item__a{ padding-bottom:20px; }

/* ---------- Forms ---------- */
.form-field{ margin-bottom:18px; }
.form-field label{ display:block; font-family:var(--font-display); font-weight:700; margin-bottom:6px; font-size:.92rem; }
.form-field input, .form-field textarea, .form-field select{
  width:100%; padding:14px 16px; border-radius:var(--radius-sm);
  border:2px solid var(--line); font-family:var(--font-body); font-size:1rem;
  background:var(--white);
}
.form-field input:focus, .form-field textarea:focus{ outline:none; border-color:var(--sun); }

/* ---------- Footer ---------- */
.site-footer{
  background:var(--jungle-deep); color:rgba(255,255,255,.85);
  padding:56px 0 24px;
}
.footer-grid{
  display:grid; gap:32px;
  grid-template-columns:1fr;
  margin-bottom:36px;
}
@media(min-width:768px){
  .footer-grid{ grid-template-columns:1.4fr 1fr 1fr 1fr; }
}
.site-footer h4{ color:var(--white); font-size:1rem; margin-bottom:14px; }
.site-footer a{ color:rgba(255,255,255,.75); }
.site-footer a:hover{ color:var(--sun); }
.site-footer li{ margin-bottom:10px; }
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.15);
  padding-top:20px; font-size:.85rem; text-align:center;
  color:rgba(255,255,255,.6);
}
.footer-logo{ font-family:var(--font-display); font-weight:800; color:var(--white); font-size:1.3rem; margin-bottom:10px; }

/* ---------- Utility ---------- */
/* Visible by default so content is never hidden if JS fails to run
   (e.g. blocked script, slow load, file:// edge cases). JS opts elements
   into the hidden pre-state via .reveal-armed, then reveals with .in. */
.reveal{ opacity:1; transform:none; }
.reveal.reveal-armed{ opacity:0; transform:translateY(24px); transition:opacity .6s ease, transform .6s ease; }
.reveal.reveal-armed.in{ opacity:1; transform:none; }
.badge-row{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:18px; }
.mt-0{ margin-top:0; }
.mb-0{ margin-bottom:0; }
.sticky-cta{
  position:fixed; left:0; right:0; bottom:0; z-index:200;
  background:var(--jungle-deep);
  padding:12px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  box-shadow:0 -6px 20px rgba(0,0,0,.2);
  transform:translateY(110%);
  transition:transform .3s ease;
}
.sticky-cta.show{ transform:translateY(0); }
.sticky-cta__price{ color:var(--white); font-family:var(--font-display); font-weight:700; }
@media(min-width:900px){ .sticky-cta{ display:none; } }

.star-hunt{
  position:relative;
  background:var(--sky); border-radius:var(--radius-lg);
  padding:20px; overflow:hidden;
}
.star-hunt img{ border-radius:var(--radius-md); }
.star-hunt__star{
  position:absolute; background:none; border:none; cursor:pointer;
  font-size:1.6rem; filter:drop-shadow(0 2px 3px rgba(0,0,0,.25));
  transition:transform .15s ease;
}
.star-hunt__star:hover{ transform:scale(1.2); }
.star-hunt__star.found{ opacity:.25; pointer-events:none; transform:scale(.8) rotate(20deg); }
.star-hunt__count{
  font-family:var(--font-display); font-weight:700; color:var(--jungle-deep);
  text-align:center; margin-top:14px;
}

/* ---------- Memory Match Game ---------- */
.game-wrap{
  max-width:760px; margin:0 auto;
  background:var(--white);
  border-radius:var(--radius-lg);
  padding:20px;
  box-shadow:var(--shadow-md);
}
.game-hud{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:10px;
  margin-bottom:16px;
  font-family:var(--font-display); font-weight:700; color:var(--jungle-deep);
}
.game-hud .pill{ background:#E4F3E9; border-color:transparent; }
.memory-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
@media(min-width:640px){
  .memory-grid{ grid-template-columns:repeat(4,1fr); gap:14px; }
}
.mem-card{
  aspect-ratio:1/1;
  position:relative;
  cursor:pointer;
  perspective:800px;
  touch-action:manipulation;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.mem-card__inner{
  position:absolute; inset:0;
  transform-style:preserve-3d;
  transition:transform .35s ease;
  border-radius:var(--radius-md);
}
.mem-card.flipped .mem-card__inner,
.mem-card.matched .mem-card__inner{
  transform:rotateY(180deg);
}
.mem-card__face{
  position:absolute; inset:0;
  border-radius:var(--radius-md);
  backface-visibility:hidden;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.mem-card__back{
  background:linear-gradient(160deg,var(--jungle),var(--jungle-deep));
  font-size:2rem;
}
.mem-card__front{
  transform:rotateY(180deg);
  background:var(--white);
  border:3px solid var(--sun);
}
.mem-card__front img{ width:100%; height:100%; object-fit:cover; }
.mem-card.matched .mem-card__front{ border-color:var(--jungle); }
.mem-card.matched{ animation:pop .4s ease; }
@keyframes pop{
  0%{ transform:scale(1); } 50%{ transform:scale(1.08); } 100%{ transform:scale(1); }
}
.game-win{
  display:none;
  text-align:center;
  background:#FFF6E4;
  border-radius:var(--radius-md);
  padding:26px;
  margin-top:18px;
}
.game-win.show{ display:block; }
.game-difficulty{ display:flex; gap:8px; flex-wrap:wrap; }
.game-difficulty button{
  font-family:var(--font-display); font-weight:700; font-size:.85rem;
  padding:9px 16px; border-radius:var(--radius-pill);
  border:2px solid var(--line); background:var(--white); cursor:pointer;
}
.game-difficulty button.active{ background:var(--jungle); color:#fff; border-color:var(--jungle); }

.pill-list{ display:flex; flex-wrap:wrap; gap:10px; }
.pill{
  background:var(--white); border:1px solid var(--line);
  padding:8px 16px; border-radius:var(--radius-pill); font-size:.88rem; font-weight:700;
  font-family:var(--font-display); color:var(--jungle-deep);
}

/* ===========================================================
   ON-SITE FAQ CHAT WIDGET
=========================================================== */
#ss-chat{ position:fixed; right:18px; bottom:18px; z-index:300; font-family:var(--font-body); }
#ss-chat-toggle{
  width:58px; height:58px; border-radius:50%;
  background:var(--jungle-deep); color:#fff; border:none;
  font-size:1.5rem; cursor:pointer; box-shadow:var(--shadow-lg);
  display:flex; align-items:center; justify-content:center;
  transition:transform .15s ease;
}
#ss-chat-toggle:hover{ transform:scale(1.06); }
#ss-chat-panel{
  position:absolute; right:0; bottom:72px;
  width:320px; max-width:calc(100vw - 36px);
  background:var(--white); border-radius:var(--radius-md);
  box-shadow:var(--shadow-lg); border:1px solid var(--line);
  display:flex; flex-direction:column; overflow:hidden;
}
#ss-chat-panel[hidden]{ display:none; }
#ss-chat-header{
  background:var(--jungle-deep); color:#fff;
  padding:14px 16px; display:flex; align-items:center; justify-content:space-between;
  font-family:var(--font-display); font-weight:700;
}
#ss-chat-header button{
  background:none; border:none; color:#fff; font-size:1rem; cursor:pointer; opacity:.85;
}
#ss-chat-body{
  padding:14px; display:flex; flex-direction:column; gap:10px;
  max-height:320px; overflow-y:auto; background:var(--cream);
}
.ss-chat-msg{
  padding:9px 13px; border-radius:14px; font-size:.88rem; line-height:1.4;
  max-width:88%;
}
.ss-chat-msg--bot{
  background:var(--white); border:1px solid var(--line); color:var(--ink);
  align-self:flex-start; border-bottom-left-radius:4px;
}
.ss-chat-msg--user{
  background:var(--jungle); color:#fff;
  align-self:flex-end; border-bottom-right-radius:4px;
}
.ss-chat-msg a{ color:inherit; text-decoration:underline; }
#ss-chat-chips{ display:flex; flex-wrap:wrap; gap:6px; padding:0 14px 10px; background:var(--cream); }
.ss-chat-chip{
  background:var(--white); border:1px solid var(--line); color:var(--jungle-deep);
  font-size:.76rem; font-weight:700; padding:6px 10px; border-radius:var(--radius-pill);
  cursor:pointer; font-family:var(--font-body);
}
.ss-chat-chip:hover{ background:var(--sun); border-color:var(--sun); }
#ss-chat-form{
  display:flex; border-top:1px solid var(--line); background:var(--white);
}
#ss-chat-form input{
  flex:1; border:none; padding:12px 14px; font-size:.88rem; font-family:var(--font-body); outline:none;
}
#ss-chat-form button{
  background:var(--jungle-deep); color:#fff; border:none; width:48px; cursor:pointer; font-size:1rem;
}
@media(max-width:899px){
  #ss-chat{ bottom:78px; right:14px; }
  #ss-chat-toggle{ width:52px; height:52px; }
}
