/* XVH homepage: animated island scene and playful sections */
.home { overflow-x: hidden; }

/* ---------- Scene ---------- */
.scene { position: relative; min-height: 640px; overflow: hidden; background: linear-gradient(180deg, #8FD8FF 0%, #C9EEFF 55%, #FFF3D1 100%); }
.sky { position: absolute; inset: 0; }
.sky-sun { position: absolute; top: 40px; right: 8%; width: 130px; height: 130px; }
.sun-rays { position: absolute; inset: -30px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(254, 209, 0, .55) 0 10deg, transparent 10deg 30deg);
  animation: spin 24s linear infinite; }
.sun-face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-size: 56px;
  background: radial-gradient(circle at 35% 35%, #FFF07A, #FED100 60%, #F5B800); box-shadow: 0 0 60px rgba(254, 209, 0, .7);
  animation: pulse 4s ease-in-out infinite; }
.cloud { position: absolute; width: 160px; height: 52px; background: #fff; border-radius: 60px; opacity: .95; filter: drop-shadow(0 6px 0 rgba(30, 36, 48, .06)); }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 70px; height: 70px; top: -34px; left: 26px; }
.cloud::after { width: 90px; height: 90px; top: -50px; left: 66px; }
.cloud.c1 { top: 70px; animation: drift 46s linear infinite; }
.cloud.c2 { top: 170px; transform: scale(.7); animation: drift 62s linear infinite -20s; }
.cloud.c3 { top: 30px; transform: scale(.55); animation: drift 80s linear infinite -50s; }

.mascot { position: absolute; width: 150px; top: 120px; left: -200px; z-index: 3; cursor: pointer; animation: fly 22s ease-in-out infinite; filter: drop-shadow(0 8px 6px rgba(0, 0, 0, .15)); }
.mascot .wing { transform-origin: 72px 48px; animation: flap .18s ease-in-out infinite alternate; }
.mascot .tail { animation: tail 1.2s ease-in-out infinite alternate; transform-origin: 40px 72px; }
.speech { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 4; max-width: min(92vw, 420px);
  background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: 10px 16px; font-weight: 800; text-align: center;
  box-shadow: 0 5px 0 rgba(30, 36, 48, .15); transition: opacity .3s; }
.speech::after { content: ''; position: absolute; bottom: -12px; left: 40px; border: 10px solid transparent; border-top-color: var(--ink); }

.balloons { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.balloon { position: absolute; bottom: -140px; width: 70px; height: 86px; border-radius: 50% 50% 48% 48%; pointer-events: auto; cursor: pointer;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; font-size: 30px; color: #fff; border: 0; padding: 0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .2); box-shadow: inset -10px -12px 0 rgba(0, 0, 0, .12), inset 8px 8px 0 rgba(255, 255, 255, .25);
  animation: rise linear forwards; }
.balloon::after { content: ''; position: absolute; top: 100%; left: 50%; width: 2px; height: 46px; background: rgba(30, 36, 48, .35); }
.balloon.pop { animation: pop .25s ease-out forwards !important; }

.scene-content { position: relative; z-index: 5; max-width: 760px; margin: 0 auto; padding: 120px 16px 190px; text-align: center; }
.scene-content .eyebrow { background: rgba(255, 255, 255, .9); }
.bounce-title { font-size: clamp(46px, 9vw, 92px); margin: .25em 0 .15em; line-height: 1; color: var(--ink); text-shadow: 0 5px 0 rgba(255, 255, 255, .7); }
.bounce-title span { display: inline-block; animation: hop 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * .08s); }
.bounce-title .and { font-size: .6em; color: var(--ink-soft); animation: none; }
.bounce-title .grow { color: var(--brand-green); background: linear-gradient(transparent 62%, var(--gold) 62%); animation: grow 3s ease-in-out infinite; }
.scene-content .lead { font-size: 20px; font-weight: 700; max-width: 34em; margin: 0 auto 18px; }
.hero-cta { justify-content: center; margin-bottom: 10px; }
.popped { min-height: 26px; font-weight: 800; color: var(--primary-dark); }
.wiggle-hover:hover { animation: wiggle .4s ease-in-out; }

.land { position: absolute; bottom: 0; left: 0; width: 100%; height: 200px; z-index: 1; }
.palm { position: absolute; bottom: 70px; left: 6%; z-index: 2; font-size: 120px; transform-origin: bottom center; animation: sway 4s ease-in-out infinite; }
.waves { position: absolute; bottom: 0; left: 0; width: 100%; height: 46px; z-index: 2; overflow: hidden; }
.wave { position: absolute; bottom: 0; left: 0; width: 200%; height: 46px;
  background: radial-gradient(circle at 25px -8px, transparent 26px, #29A9E1 27px) 0 0 / 50px 46px repeat-x; animation: waves 8s linear infinite; }
.wave.w2 { opacity: .55; bottom: 8px; animation-duration: 12s; animation-direction: reverse; }

/* ---------- Counters ---------- */
.counters { max-width: 1000px; margin: -40px auto 0; position: relative; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 16px; }
.counter { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 16px; text-align: center; font-weight: 800; color: var(--ink-soft); }
.counter .num { display: block; font-family: var(--font-head); font-size: 40px; color: var(--primary); line-height: 1.1; }
@media (max-width: 640px) { .counters { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Quick maths ---------- */
.quick { max-width: 720px; margin: 36px auto 0; padding: 0 16px; }
.quick-card { background: linear-gradient(135deg, var(--navy), #123E96); color: #fff; border-radius: 28px; padding: 24px; text-align: center; box-shadow: var(--shadow); }
.quick-card h2 { color: var(--gold); font-size: 30px; margin-bottom: 4px; }
.quick-q { font-family: var(--font-head); font-size: clamp(34px, 7vw, 52px); font-weight: 800; margin: 8px 0 14px; }
.quick-answers { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.bubble-btn { width: 96px; height: 96px; border-radius: 50%; border: 0; cursor: pointer; font-family: var(--font-head); font-weight: 800; font-size: 34px; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff, #BDE8FF 60%, #7FD3F7); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); animation: float 3s ease-in-out infinite; }
.bubble-btn:nth-child(2) { animation-delay: -1s; background: radial-gradient(circle at 35% 30%, #fff, #FFE9A8 60%, #FED100); }
.bubble-btn:nth-child(3) { animation-delay: -2s; background: radial-gradient(circle at 35% 30%, #fff, #FFD0E4 60%, #F06BA8); }
.bubble-btn.right { animation: pop .35s ease-out forwards; }
.bubble-btn.wrong { animation: shake .35s; }
.quick-score { margin: 14px 0 0; font-weight: 800; color: #CFD5DF; }

/* ---------- Islands ---------- */
.section-title { font-size: clamp(28px, 4.5vw, 40px); text-align: center; margin-bottom: 18px; }
.islands { max-width: 1120px; margin: 48px auto 0; padding: 0 16px; }
.island-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.island { --accent: var(--primary); position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; text-decoration: none; padding: 26px 18px 22px;
  border-radius: 28px; background: #fff; box-shadow: var(--shadow); border-bottom: 10px solid var(--accent); transition: transform .2s; }
.island:hover { transform: translateY(-6px) rotate(-1deg); }
.island-icon { font-size: 64px; line-height: 1; animation: bob 3s ease-in-out infinite; animation-delay: var(--d); }
.island strong { font-family: var(--font-head); font-size: 24px; }
.island span:last-child { color: var(--ink-soft); font-weight: 700; }

/* ---------- Fresh marquee ---------- */
.fresh { margin-top: 48px; }
.marquee { overflow: hidden; padding: 8px 0 16px; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track, .marquee:focus-within .marquee-track { animation-play-state: paused; }
.fresh-tile { --accent: var(--sky); display: grid; gap: 4px; width: 210px; padding: 16px; border-radius: 20px; background: #fff; text-decoration: none;
  box-shadow: var(--shadow); border-top: 6px solid var(--accent); }
.fresh-tile:hover { transform: translateY(-3px); }
.fresh-icon { font-size: 36px; }

/* ---------- How it works ---------- */
.how { max-width: 1120px; margin: 48px auto 0; padding: 0 16px; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.how-step { position: relative; display: grid; gap: 6px; background: #fff; border-radius: 22px; padding: 22px 18px 18px; box-shadow: var(--shadow); }
.how-num { position: absolute; top: -14px; left: 18px; width: 36px; height: 36px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-family: var(--font-head); font-weight: 800; box-shadow: 0 3px 0 var(--gold-dark); }
.how-icon { font-size: 40px; }
.how-step b { font-family: var(--font-head); font-size: 22px; }
.how-step span:last-child { color: var(--ink-soft); font-weight: 600; }
.chip-new.is-on { background: var(--primary); border-color: var(--primary); }
.tag-new { background: #FFF1B8 !important; }
.sort-pick { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; }
.sort-pick select { width: auto; padding: 8px 10px; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 24px; }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes drift { from { left: -220px; } to { left: 110%; } }
@keyframes fly { 0% { left: -200px; top: 140px; transform: scaleX(1); } 45% { left: 105%; top: 90px; transform: scaleX(1); }
  50% { left: 105%; top: 90px; transform: scaleX(-1); } 95% { left: -200px; top: 150px; transform: scaleX(-1); } 100% { left: -200px; top: 140px; transform: scaleX(1); } }
@keyframes flap { from { transform: rotate(-18deg); } to { transform: rotate(16deg); } }
@keyframes tail { to { transform: rotate(6deg); } }
@keyframes rise { to { transform: translateY(calc(-100vh - 300px)) rotate(8deg); } }
@keyframes pop { 60% { transform: scale(1.35); opacity: .8; } 100% { transform: scale(0); opacity: 0; } }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-14px); } 90% { transform: translateY(2px); } }
@keyframes grow { 50% { transform: scale(1.08) rotate(-2deg); } }
@keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
@keyframes sway { 50% { transform: rotate(-6deg); } }
@keyframes waves { to { transform: translateX(-50%); } }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (max-width: 640px) {
  .scene { min-height: 600px; }
  .sky-sun { width: 90px; height: 90px; right: 4%; top: 80px; }
  .sun-face { font-size: 40px; }
  .palm { font-size: 80px; left: 2%; }
  .mascot { width: 110px; }
  .scene-content { padding-top: 130px; }
  /* Phones: the text fills the width, so balloons stay in the open space below it and fade out before reaching it. */
  .balloon { width: 54px; height: 66px; font-size: 24px; animation-name: rise-low; }
  .balloon::after { height: 34px; }
}
@keyframes rise-low { 0% { transform: translateY(0); } 75% { opacity: 1; } 100% { transform: translateY(-235px) rotate(6deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .mascot { left: 8%; top: 150px; }
  .balloons { display: none; }
}
/* Let taps reach balloons behind the text; keep links and buttons clickable. */
.scene-content { pointer-events: none; }
.scene-content a, .scene-content button { pointer-events: auto; }

.bounce-title { color: var(--navy); }
.counter .num { background: linear-gradient(90deg, var(--primary), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
