/* Pip's Play Club — promo site. Mobile first (phones are the base, wider screens add on top).
   Same palette as the app: sky blue, cream cards, gold borders, candy buttons. */
:root {
  --cream: #FFF8EE;
  --ink: #4A2E1F;
  --gold: #F5B90A;
  --blue: #2E8BEA;
  --blue-dark: #1858B8;
  --green: #43A047;
  --sky-top: #5DBEF5;
  --sky-mid: #96D8FA;
  --sky-low: #CFEFFF;
  --radius: 28px;
  --shadow: 0 6px 0 rgba(24, 88, 184, .12), 0 14px 30px rgba(24, 88, 184, .12);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; scrollbar-color: var(--green) #e3f4e4; }
body {
  margin: 0; position: relative; min-height: 100vh; display: flex; flex-direction: column;
  font: 600 17px/1.55 "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: var(--sky-low);
  overflow-x: hidden;
}
main { flex: 1 0 auto; }
/* green scrollbars (Safari / older Chrome; others use scrollbar-color) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #e3f4e4; }
::-webkit-scrollbar-thumb { background: var(--green); border-radius: 999px; border: 3px solid #e3f4e4; }
::-webkit-scrollbar-thumb:hover { background: #2e7d32; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-dark); }
h1, h2, h3 { font-weight: 900; line-height: 1.15; margin: 0 0 .5em; }

/* ---------- sky (fixed, behind everything) ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: linear-gradient(var(--sky-top), var(--sky-mid) 45%, var(--sky-low));
}
.sun { position: absolute; width: clamp(90px, 11vw, 150px); top: 86px; right: 9%; animation: sun 7s ease-in-out infinite; }
.cloud { position: absolute; width: clamp(260px, 34vw, 520px); opacity: .95; animation: drift linear infinite; }
.c1 { top: 12vh; animation-duration: 95s; animation-delay: -20s; }
.c2 { top: 48vh; width: clamp(200px, 26vw, 400px); opacity: .8; animation-duration: 130s; animation-delay: -80s; }
@keyframes drift { from { transform: translateX(-110%); left: 0; } to { transform: translateX(110vw); left: 0; } }
@keyframes sun { 50% { transform: rotate(6deg) scale(1.05); } }

/* ---------- forest ground: bottom of the page, under the footer ---------- */
.ground {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; pointer-events: none;
  /* phones: only the picture's lower part (left tree, flowers, grass) - its deep-blue sky would show otherwise */
  height: 440px;
  background: url(/img/forest-1024.webp) 8% bottom / auto 620px no-repeat;
  -webkit-mask-image: linear-gradient(transparent, #000 32%);
  mask-image: linear-gradient(transparent, #000 32%);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 18px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: rgba(255, 248, 238, .88); backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--gold);
}
.brand img { width: 96px; }
.nav { display: none; gap: 4px; margin: 0 auto; flex-wrap: wrap; }
.nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 800; }
.nav a:hover { background: #fff; color: var(--blue-dark); }
.langs { display: flex; gap: 6px; margin-left: auto; }
.langs a {
  min-width: 44px; padding: 6px 10px; text-align: center; border-radius: 999px; text-decoration: none;
  font-weight: 900; color: var(--ink); background: #fff; border: 2px solid var(--gold);
}
.langs a.on { background: var(--blue); color: #fff; border-color: #fff; }

/* ---------- buttons ---------- */
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; color: #fff; font-weight: 900; font-size: 19px;
  background: linear-gradient(#7fd2ff, #3a9af2 55%, #1d6cd3);
  border: 4px solid #fff; box-shadow: 0 6px 0 #1450b0, 0 0 0 5px #a6dcff;
  text-shadow: 0 2px 3px rgba(13, 63, 143, .6);
  position: relative; overflow: hidden;
}
.store-badge::after { /* the app's sweeping shine */
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.btn-soft {
  display: inline-block; padding: 12px 22px; border-radius: 999px; text-decoration: none;
  background: var(--cream); color: var(--blue-dark); font-weight: 900; border: 3px solid var(--gold);
}
.btn-soft:hover { transform: translateY(-2px); }

/* ---------- hero ---------- */
.hero {
  max-width: 1180px; margin: 0 auto; padding: clamp(36px, 7vw, 90px) clamp(16px, 4vw, 48px) 40px;
  display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; text-align: center;
}
.kicker { display: inline-block; margin: 0 0 12px; padding: 6px 16px; border-radius: 999px; background: #fff; color: var(--green); font-weight: 900; }
.hero h1 {
  font-size: clamp(36px, 5.6vw, 68px); color: #fff;
  -webkit-text-stroke: 2px var(--blue-dark); paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--blue-dark), 0 10px 22px rgba(24, 88, 184, .3);
}
.lead { font-size: clamp(17px, 1.6vw, 21px); max-width: 34em; margin: 0 auto; background: rgba(255, 248, 238, .75); padding: 14px 18px; border-radius: 20px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; margin: 24px 0 10px; }
.free { font-weight: 800; color: var(--blue-dark); }
.hero-pip { position: relative; max-width: 300px; margin: 0 auto; order: -1; }
.pip-bounce { animation: bounce 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.pip-bounce img { animation: tilt 3.6s ease-in-out infinite; transform-origin: 40% 50%; filter: drop-shadow(0 18px 18px rgba(24, 88, 184, .25)); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes tilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.hero-star { position: absolute; width: 64px; animation: twinkle 2.2s ease-in-out infinite; }
.s1 { top: 4%; left: 2%; } .s2 { bottom: 12%; right: 0; width: 46px; animation-delay: -1.1s; }
@keyframes twinkle { 50% { transform: scale(.75) rotate(18deg); opacity: .7; } }

/* ---------- sections ---------- */
.section { position: relative; max-width: 1180px; margin: 0 auto; padding: clamp(44px, 7vw, 70px) clamp(16px, 4vw, 48px); }
.section h2 {
  text-align: center; font-size: clamp(30px, 4vw, 46px); color: #fff;
  -webkit-text-stroke: 1.5px var(--blue-dark); paint-order: stroke fill; text-shadow: 0 4px 0 var(--blue-dark);
}
.section-lead { text-align: center; max-width: 40em; margin: 0 auto 34px; background: rgba(255, 248, 238, .75); padding: 10px 18px; border-radius: 18px; }

/* world (category) cards: the app's colours */
.worlds { display: grid; grid-template-columns: 1fr; gap: 18px; }
.world {
  background: var(--c); color: #fff; border: 4px solid #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); text-shadow: 0 2px 4px rgba(0, 0, 0, .25);
}
.world-icon { font-size: 54px; display: block; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .15)); }
.world h3 { font-size: 26px; margin: 8px 0 6px; }
.world p { margin: 0; font-weight: 700; }
.world:hover { transform: translateY(-6px) rotate(-1deg); }

/* screenshots: swipeable phone row */
.shots { display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 6px 26px; scrollbar-color: var(--green) rgba(255, 248, 238, .85); }
.shots::-webkit-scrollbar-track { background: rgba(255, 248, 238, .85); border-radius: 999px; }
.shots::-webkit-scrollbar-thumb { border-color: rgba(255, 248, 238, .85); }
.shot { flex: 0 0 auto; width: clamp(190px, 22vw, 250px); margin: 0; scroll-snap-align: center; text-align: center; }
.phone { border: 8px solid #fff; border-radius: 34px; overflow: hidden; box-shadow: var(--shadow), 0 0 0 4px var(--gold); background: #fff; }
.shot figcaption { margin-top: 12px; font-weight: 900; background: var(--cream); display: inline-block; padding: 4px 14px; border-radius: 999px; border: 2px solid var(--gold); }

/* cream feature cards */
.cards, .cards.four { display: grid; grid-template-columns: 1fr; gap: 18px; }
.card { background: var(--cream); border: 3px solid var(--gold); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-icon { font-size: 44px; display: block; }
.card h3 { font-size: 22px; margin: 10px 0 6px; color: var(--blue-dark); }
.card p { margin: 0; }

.finale-card {
  display: flex; flex-direction: column; text-align: center; gap: 20px; align-items: center; max-width: 860px; margin: 0 auto;
  background: var(--cream); border: 4px solid var(--gold); border-radius: 36px; padding: 28px 34px; box-shadow: var(--shadow);
}
.finale-card .castle { width: 180px; flex: 0 0 auto; animation: bounce 3s ease-in-out infinite; }
.finale-card h2 { text-align: center; }

/* static pages */
.page { min-height: 60vh; }
.page-card { max-width: 820px; margin: 0 auto; background: var(--cream); border: 3px solid var(--gold); border-radius: var(--radius); padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); }
.page-card h1 { color: var(--blue-dark); font-size: clamp(30px, 4vw, 42px); }
.page-content h2 { font-size: 24px; color: var(--blue-dark); text-align: left; -webkit-text-stroke: 0; text-shadow: none; margin-top: 1.4em; }
.page-content h3 { font-size: 20px; }
.page-back { margin-top: 30px; }
.center { text-align: center; }
.lost-pip { width: 200px; margin: 0 auto 10px; animation: tilt 3s ease-in-out infinite; }

/* ---------- side decorations: slide in from the edge, then drift with scroll ---------- */
.side {
  display: none; position: absolute; z-index: 0; width: clamp(110px, 14vw, 230px); top: 40px; pointer-events: none;
  /* two independent motions: `translate` = slide in from the edge (animated once),
     `transform` = scroll parallax (set every frame by site.js, no transition so it never lags) */
  transform: translateY(var(--py, 0px)); opacity: 0;
  transition: opacity .8s ease, translate 1.1s cubic-bezier(.2, 1.4, .4, 1);
}
.side.small { width: clamp(70px, 8vw, 130px); top: auto; bottom: 30px; }
.side.left { left: calc(-1 * clamp(40px, 7vw, 120px)); translate: -70% 0; }
.side.right { right: calc(-1 * clamp(40px, 7vw, 120px)); translate: 70% 0; }
.side.in { opacity: 1; translate: 0 0; }
.section > *:not(.side) { position: relative; z-index: 1; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px) scale(.98); transition: opacity .7s ease var(--d, 0ms), transform .7s cubic-bezier(.2, 1.3, .4, 1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- footer: on the forest's grass (the .ground layer), at the very bottom ---------- */
.footer { padding-top: clamp(140px, 22vw, 320px); }
.footer-inner {
  width: 100%; display: grid; grid-template-columns: 1fr; gap: 8px 24px; align-items: end;
  padding: 0 clamp(16px, 4vw, 48px) 22px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; grid-column: 1 / -1; }
.footer-links a, .copy, .made {
  background: rgba(255, 248, 238, .92); padding: 6px 14px; border-radius: 999px; border: 2px solid var(--gold);
  text-decoration: none; color: var(--ink); font-weight: 800; font-size: 15px;
}
.copy { margin: 0; justify-self: start; }
.made { justify-self: end; }   /* bottom-right */
.footer-links a:hover, .made:hover { background: #fff; }
.made .heart { color: #ef5350; display: inline-block; animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 30% { transform: scale(1.3); } 60% { transform: scale(1); } }

/* ---------- free vs pro ---------- */
.plans { display: grid; grid-template-columns: 1fr; gap: 22px; max-width: 1120px; margin: 0 auto; }
.plan { position: relative; background: var(--cream); border: 3px solid var(--gold); border-radius: var(--radius); padding: 26px 24px 22px; box-shadow: var(--shadow); }
.plan h3 { font-size: 28px; margin: 0; color: var(--blue-dark); }
.price { font-size: 40px; font-weight: 900; margin: 4px 0 14px; color: var(--ink); }
.price small { font-size: 16px; font-weight: 800; color: var(--green); }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
/* ticks pop in one after another once the card is revealed */
.plan li { position: relative; padding-left: 34px; font-weight: 700; opacity: 0; transform: translateX(-12px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, 1.4, .4, 1); transition-delay: calc(350ms + var(--i, 0) * 110ms); }
.plan.in li { opacity: 1; transform: none; }
.plan li::before { content: "✓"; position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 900; color: #fff; background: var(--green); }
.plan-pro { border-color: transparent; overflow: hidden;
  background: linear-gradient(var(--cream), var(--cream)) padding-box, linear-gradient(135deg, #FFD54F, #FF9800, #FFD54F) border-box;
  border-width: 4px; box-shadow: var(--shadow), 0 0 0 6px rgba(255, 193, 7, .18); }
.plan-mid { border-color: var(--blue); }
.plan-mid li::before { background: var(--blue); }
.plan-pro li::before { content: "★"; background: linear-gradient(135deg, #FFC107, #FF9800); }
.plan-pro::after { /* slow shine sweeping across the Pro card */
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 34%; left: -60%; transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: shine 4.5s ease-in-out infinite; pointer-events: none; }
.plan-badge { position: absolute; top: 18px; right: 18px; padding: 6px 14px; border-radius: 999px; font-weight: 900; color: var(--ink);
  background: linear-gradient(135deg, #FFE082, #FFB300); box-shadow: 0 4px 10px rgba(255, 152, 0, .35); animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.plan-star { position: absolute; width: 34px; opacity: .9; animation: twinkle 2.4s ease-in-out infinite; pointer-events: none; }
.plan-star.b { right: 26px; bottom: 22px; width: 26px; animation-delay: -1.2s; }
.plan-note { text-align: center; margin: 22px auto 0; font-weight: 800; background: rgba(255, 248, 238, .85); display: table; padding: 8px 18px; border-radius: 999px; }

/* ---------- wider screens ---------- */
@media (min-width: 601px) {
  body { font-size: 18px; }
  .brand img { width: 110px; }
  .worlds, .cards, .cards.four { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .plans { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .plan-pro { grid-column: 1 / -1; }
  .finale-card { flex-direction: row; text-align: left; gap: 30px; }
  .finale-card .castle { width: 220px; }
  .finale-card h2 { text-align: left; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .hero-pip { max-width: 360px; }
  .ground { height: clamp(420px, 62vw, 1080px); background-size: cover; background-position: center bottom; }
}
@media (min-width: 961px) {
  .nav { display: flex; }
  .hero { grid-template-columns: 1.1fr .9fr; gap: 30px; text-align: left; }
  .hero-pip { max-width: none; margin: 0; order: 0; }
  .cta-row { justify-content: flex-start; }
  .lead { margin: 0; }
  .worlds, .cards { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .plan-pro { grid-column: auto; }
  .cards.four { grid-template-columns: repeat(4, 1fr); }
  .side { display: block; }
  .ground { background-image: url(/img/forest.webp); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .side, .plan li { opacity: 1; transform: none; }
}

/* ---------- contact form ---------- */
.contact-form { display: grid; gap: 16px; margin-top: 18px; }
.contact-form label { display: grid; gap: 6px; font-weight: 800; color: var(--blue-dark); }
.contact-form input, .contact-form textarea {
  font: inherit; color: var(--ink); background: #fff; border: 3px solid #f3dfa8; border-radius: 16px; padding: 12px 14px; width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 150px; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--blue); }
.contact-form button { justify-self: start; cursor: pointer; font: inherit; font-weight: 900; }
.contact-form button:disabled { opacity: .5; cursor: wait; }
.form-note { margin: -4px 0 0; font-size: 14px; opacity: .75; }
.form-ok, .form-err { padding: 14px 18px; border-radius: 16px; font-weight: 800; }
.form-ok { background: #e3f4e4; color: #2e7d32; }
.form-err { background: #ffe5e5; color: #b3261e; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
