/* BeadIQ public homepage. Uses the colours and buttons from style.css. */
html { scroll-behavior: smooth; }
.home main { max-width: none; padding: 0; }
.home section[id] { scroll-margin-top: 70px; }

.home-nav { position: sticky; top: 0; z-index: 5; }
.nav-links { display: flex; gap: 18px; font-weight: 700; }
.nav-links a { color: var(--muted); text-decoration: none; }
.nav-links a:hover { color: var(--brand); }
.nav-cta { display: flex; gap: 8px; }
.home .btn { text-decoration: none; display: inline-block; }
.btn.big { font-size: 20px; padding: 12px 24px; }

.hero {
  max-width: 1100px; margin: 0 auto; padding: 48px 16px 40px;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center;
}
.eyebrow { display: inline-block; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 2px 14px; font-weight: 700; color: var(--brand); }
.hero h1 { font-size: clamp(34px, 5vw, 54px); margin: 14px 0 10px; }
.hl { background: linear-gradient(90deg, var(--brand), var(--brand2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 20px; color: var(--muted); margin: 0 0 20px; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 700; }
.ticks.big { flex-direction: column; font-size: 18px; gap: 10px; }

.hero-abacus { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.try-label { font-weight: 800; color: var(--brand); font-size: 20px; }
.try-value { font-size: 52px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.try-hint { margin: 4px 0 0; color: var(--muted); font-weight: 700; text-align: center; }

.section { max-width: 1100px; margin: 0 auto; padding: 56px 16px; }
.section.alt { max-width: none; background: var(--card); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.section.alt > * { max-width: 1068px; margin-left: auto; margin-right: auto; }
.section-title { font-size: clamp(28px, 4vw, 38px); text-align: center; margin: 0 0 8px; }
.section-sub { text-align: center; color: var(--muted); font-size: 18px; margin: 0 auto 28px; max-width: 640px; }
.section-title.left, .section-sub.left { text-align: left; margin-left: 0; }

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature h3 { margin: 6px 0 4px; }
.feature p { margin: 0; color: var(--muted); }
.f-icon { font-size: 38px; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 24px; }
.step { text-align: center; }
.step h3 { margin: 8px 0 4px; }
.step p { margin: 0; color: var(--muted); }
.step-num {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 26px; font-weight: 800;
}

.home-levels .level { cursor: default; }
.home-levels .level:hover { transform: none; }
.home-levels .lv-sub { min-height: 0; }

.game-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.mini-game { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.mini-game span { font-size: 40px; }
.mini-game small { color: var(--muted); }

.parents { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.report-mock { display: flex; flex-direction: column; gap: 12px; }
.rm-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 20px; }
.rm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rm-stats div { border: 2px solid var(--line); border-radius: 12px; padding: 6px 8px; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; }
.rm-stats b { font-size: 24px; color: var(--ink); }
.rm-bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; border-bottom: 2px solid var(--line); }
.rm-bars i { flex: 1; background: var(--good); border-radius: 6px 6px 0 0; }
.rm-hw { font-weight: 700; }

.faq { max-width: 760px; margin: 24px auto 0; display: flex; flex-direction: column; gap: 10px; }
.faq details { background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 10px 16px; }
.faq summary { font-weight: 800; font-size: 18px; cursor: pointer; }
.faq p { margin: 8px 0 2px; color: var(--muted); }

.demo-card { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; padding: 28px; border-color: var(--brand); }
.demo-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.demo-form label { display: flex; flex-direction: column; gap: 2px; font-weight: 700; color: var(--muted); font-size: 15px; }
.demo-form .wide, .demo-form button.wide { grid-column: 1 / -1; }
.demo-form textarea { resize: vertical; }
.demo-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.demo-done { text-align: center; align-self: center; }
.wa-box { margin-top: 12px; }

.footer {
  border-top: 2px solid var(--line); background: var(--card); padding: 28px 16px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
}
.footer p { margin: 2px 0 0; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 700; }
.footer-links a { color: var(--brand); text-decoration: none; }

.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 6; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px; text-decoration: none;
  background: #25d366; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero, .parents, .demo-card { grid-template-columns: 1fr; }
  .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .game-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .feature-grid, .steps, .demo-form { grid-template-columns: 1fr; }
  .game-strip { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 28px; }
  .btn.big { font-size: 18px; width: 100%; text-align: center; }
}

/* ---- Look & feel refresh ---- */
.home-nav { backdrop-filter: blur(8px); background: color-mix(in srgb, var(--card) 88%, transparent); }

/* Hero: soft colour blobs and floating beads behind the text */
.hero-bg { position: relative; overflow: hidden; isolation: isolate; }
.hero-bg::before, .hero-bg::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; z-index: -1;
}
.hero-bg::before { width: 420px; height: 420px; background: var(--brand); top: -140px; left: -120px; }
.hero-bg::after { width: 380px; height: 380px; background: var(--brand2); bottom: -160px; right: -100px; }
.float-beads { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.float-beads i {
  position: absolute; width: 34px; height: 22px; border-radius: 50%; opacity: .55;
  background: linear-gradient(180deg, var(--bead-on), var(--bead-on2));
  animation: drift 9s ease-in-out infinite;
}
.float-beads i:nth-child(2n) { background: linear-gradient(180deg, var(--bead), var(--bead2)); }
.float-beads i:nth-child(3n) { background: linear-gradient(180deg, #a78bfa, var(--brand)); }
.float-beads i:nth-child(1) { left: 4%; top: 18%; }
.float-beads i:nth-child(2) { left: 44%; top: 8%; animation-delay: -2s; scale: .7; }
.float-beads i:nth-child(3) { left: 38%; bottom: 10%; animation-delay: -4s; }
.float-beads i:nth-child(4) { right: 3%; top: 12%; animation-delay: -1s; }
.float-beads i:nth-child(5) { right: 8%; bottom: 8%; animation-delay: -6s; scale: .8; }
.float-beads i:nth-child(6) { left: 18%; bottom: 4%; animation-delay: -3s; scale: .6; }
.float-beads i:nth-child(7) { left: 55%; top: 46%; animation-delay: -5s; scale: .5; }
@keyframes drift { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -18px; rotate: 12deg; } }

.hero-abacus { position: relative; padding-top: 38px; box-shadow: 0 18px 40px rgba(76, 29, 149, .14); }
.hero-badge {
  position: absolute; display: flex; align-items: center; gap: 8px; z-index: 1;
  background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .1); animation: bob 4s ease-in-out infinite;
}
.hero-badge span { font-size: 22px; }
.hero-badge b { display: block; line-height: 1.1; }
.hero-badge small { color: var(--muted); }
.hero-badge.b1 { bottom: 120px; left: -34px; }
.hero-badge.b2 { top: -26px; right: -10px; animation-delay: -2s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

.btn.primary.big { box-shadow: 0 5px 0 #5b21b6, 0 12px 24px rgba(124, 58, 237, .28); }

/* Trust numbers */
.stats-band { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px;
  background: linear-gradient(90deg, var(--brand), #9333ea 60%, var(--brand2)); color: #fff;
  border-radius: 22px; padding: 18px 12px; box-shadow: 0 14px 30px rgba(124, 58, 237, .25);
}
.stats-row div { text-align: center; display: flex; flex-direction: column; }
.stats-row b { font-size: 34px; line-height: 1.1; }
.stats-row span { font-weight: 700; opacity: .92; }

/* Cards lift a little on hover */
.feature, .mini-game, .review { transition: transform .2s, box-shadow .2s; }
.feature:hover, .mini-game:hover, .review:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, .08); }
.f-icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.feature:nth-child(2) .f-icon { background: color-mix(in srgb, var(--brand2) 18%, transparent); }
.feature:nth-child(3) .f-icon { background: color-mix(in srgb, var(--good) 14%, transparent); }
.feature:nth-child(4) .f-icon { background: color-mix(in srgb, var(--bead) 14%, transparent); }

/* How it works: icons and a dashed line joining the steps */
.steps { position: relative; }
.steps::before {
  content: ''; position: absolute; top: 78px; left: 12%; right: 12%;
  border-top: 3px dashed var(--line); z-index: 0;
}
.step { position: relative; z-index: 1; }
.step-icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.step-num { box-shadow: 0 0 0 6px var(--card); }

/* Reviews */
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.review { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.review .stars { color: #f59e0b; font-size: 20px; letter-spacing: 2px; }
.review p { margin: 0; font-size: 18px; }
.review-who { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; font-weight: 800;
}
.review-who small { display: block; color: var(--muted); }

/* Free demo call-out */
.cta-band { padding: 0 16px 56px; }
.cta-inner {
  max-width: 1068px; margin: 0 auto; border-radius: 26px; padding: 30px 32px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .22), transparent 40%), linear-gradient(120deg, #6d28d9, #9333ea 55%, #f97316);
  box-shadow: 0 16px 34px rgba(109, 40, 217, .3);
}
.cta-inner h2 { margin: 0 0 4px; font-size: clamp(26px, 3.6vw, 36px); }
.cta-inner p { margin: 0; opacity: .92; font-size: 18px; max-width: 560px; }
.btn.cta-btn { background: #fff; color: #6d28d9; box-shadow: 0 5px 0 rgba(0, 0, 0, .18); }
.cta-mascot { width: 110px; margin: -20px 0 -10px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .25)); }
.cta-text { flex: 1; min-width: 240px; }

/* Beady peeks in next to the games */
.games-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.games-head .mascot { width: 72px; }

.wa-float { animation: bob 3s ease-in-out infinite; }

/* Sections fade up as they scroll into view (home.js adds .reveal) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.shown { opacity: 1; transform: none; }

/* Banner for visitors who came from a family's invite link */
.ref-bar { display: block; text-align: center; padding: 10px 16px; background: #f59e0b; color: #2b2140; text-decoration: none; font-weight: 700; }

/* ---- Fun refresh: colour wash, floating maths, Beady, arcade strip ---- */
.hero-bg {
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 16%, var(--bg)), var(--bg) 55%, color-mix(in srgb, var(--brand2) 20%, var(--bg)));
}
.wave-div { display: block; width: 100%; height: 50px; margin-top: -10px; }
.wave-div path { fill: var(--bg); }
.float-math { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.float-math span {
  position: absolute; font-size: 42px; font-weight: 800; opacity: .16; animation: drift 10s ease-in-out infinite;
}
.float-math span:nth-child(1) { left: 2%; top: 60%; color: var(--brand); }
.float-math span:nth-child(2) { left: 30%; top: 4%; color: #ec4899; animation-delay: -3s; }
.float-math span:nth-child(3) { left: 50%; top: 70%; color: var(--brand2); animation-delay: -6s; font-size: 56px; }
.float-math span:nth-child(4) { right: 2%; top: 40%; color: #06b6d4; animation-delay: -2s; }
.float-math span:nth-child(5) { right: 40%; top: 30%; color: var(--good); animation-delay: -7s; }
.float-math span:nth-child(6) { left: 12%; top: 8%; color: #f97316; animation-delay: -4s; }
.float-math span:nth-child(7) { right: 12%; bottom: 4%; color: #ec4899; animation-delay: -1s; }
.float-math span:nth-child(8) { left: 24%; bottom: 14%; color: var(--brand); animation-delay: -5s; font-size: 30px; }

.try-label { transition: color .2s; }
.try-value span { display: inline-block; }
.try-value span.tap { animation: tap .18s ease-out; }
.hero-beady { position: absolute; left: -26px; bottom: -30px; width: 92px; z-index: 2; }
.hero-beady img { width: 100%; display: block; animation: beady 2.6s ease-in-out infinite; transform-origin: 50% 100%; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .18)); }
.beady-bubble {
  position: absolute; left: 100%; bottom: 46px; margin-left: 6px; white-space: nowrap;
  background: var(--card); border: 2px solid var(--brand); color: var(--ink); border-radius: 14px; padding: 4px 12px;
  font-weight: 800; font-size: 15px; box-shadow: 0 6px 14px rgba(0, 0, 0, .1);
}
.beady-bubble::after {
  content: ''; position: absolute; right: 100%; bottom: 8px; border: 8px solid transparent; border-right-color: var(--brand);
}
.beady-bubble.say-pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }

/* Arcade strip above the game cards */
.arcade {
  position: relative; height: 150px; margin: 0 auto 18px; border-radius: 22px; overflow: hidden; isolation: isolate;
  background: linear-gradient(90deg, #7dd3fc, #c4b5fd 45%, #4c1d95 75%, #1e1b4b);
  box-shadow: 0 14px 30px rgba(76, 29, 149, .2);
}
.arc-stars {
  position: absolute; inset: 0 0 0 55%; animation: twinkle 2.5s ease-in-out infinite alternate;
  background-image: radial-gradient(2px 2px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 70%, #fff, transparent),
    radial-gradient(2px 2px at 80% 20%, #fde68a, transparent), radial-gradient(1.5px 1.5px at 40% 85%, #fff, transparent);
}
.arc-clouds {
  position: absolute; inset: 0 45% 0 0; opacity: .9; animation: scroll-clouds 14s linear infinite;
  background-image: radial-gradient(ellipse 50px 18px at 80px 30%, #fff 98%, transparent), radial-gradient(ellipse 60px 20px at 300px 75%, #fff 98%, transparent);
  background-size: 600px 100%;
}
.arc-plane { position: absolute; top: 34px; left: 0; display: flex; align-items: center; animation: fly-across 9s linear infinite; z-index: 2; }
.arc-jet { font-size: 46px; display: inline-block; rotate: 45deg; animation: plane-bob 1s ease-in-out infinite; }
.arc-banner {
  background: #fff; color: #0c4a6e; font-weight: 800; padding: 2px 12px; border-radius: 6px; margin-right: 4px; font-size: 18px;
  border: 2px solid #0ea5e9; box-shadow: 0 4px 8px rgba(0, 0, 0, .12); animation: flutter .5s ease-in-out infinite alternate;
}
@keyframes fly-across { from { translate: -260px 0; } to { translate: calc(100vw + 40px) 0; } }
@keyframes flutter { to { rotate: 3deg; } }
.arc-alien { position: absolute; right: 12%; top: 20px; font-size: 42px; animation: alien-bob 1.4s ease-in-out infinite, alien-hit 3s ease-in-out infinite; }
.arc-rocket { position: absolute; right: 12%; bottom: 8px; font-size: 40px; rotate: -45deg; margin-right: 2px; }
.arc-laser {
  position: absolute; right: calc(12% + 19px); bottom: 56px; width: 5px; height: 40px; border-radius: 3px;
  background: linear-gradient(#fff, #22d3ee); box-shadow: 0 0 12px #22d3ee; animation: zap 3s ease-in infinite;
}
@keyframes zap { 0%, 55% { opacity: 0; translate: 0 0; } 60% { opacity: 1; } 75% { opacity: 1; translate: 0 -40px; } 76%, 100% { opacity: 0; translate: 0 -40px; } }
@keyframes alien-hit { 0%, 74% { filter: none; scale: 1; } 78% { filter: brightness(2.5); scale: 1.3; } 86% { scale: .2; opacity: 0; } 92% { opacity: 0; scale: .2; } 100% { opacity: 1; scale: 1; } }
.arc-meteor { position: absolute; left: 30%; top: -40px; font-size: 32px; animation: meteor-fall 4s linear infinite; animation-delay: 1s; }
@keyframes meteor-fall { from { translate: 0 0; } to { translate: -120px 220px; } }

.game-strip { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.mini-game { position: relative; border-top: 6px solid var(--c, var(--brand)); }
.mini-game span { display: inline-block; transition: transform .3s; }
.mini-game:hover span { animation: wobble .6s ease-in-out; }
.new-tag {
  position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 11px; font-weight: 800; color: #fff;
  background: #ec4899; border-radius: 999px; padding: 1px 8px; animation: flicker 1.2s ease-in-out infinite;
}

/* Safe and simple for families */
.safe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.safe { display: flex; flex-direction: column; gap: 2px; transition: transform .2s, box-shadow .2s; }
.safe:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, .08); }
.safe b { font-size: 19px; }
.safe span { color: var(--muted); }
.s-icon { font-size: 34px; width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 6px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); }
.safe:nth-child(2n) .s-icon { background: color-mix(in srgb, var(--brand2) 18%, transparent); }
.safe:nth-child(3n) .s-icon { background: color-mix(in srgb, var(--good) 14%, transparent); }

/* Levels: a little bounce on hover */
.home-levels .level { transition: transform .2s; }
.home-levels .level:hover { transform: translateY(-4px) rotate(-1deg); }

@media (max-width: 900px) {
  .safe-grid { grid-template-columns: 1fr 1fr; }
  .hero-beady { left: -6px; bottom: -24px; width: 76px; }
}
@media (max-width: 560px) {
  .safe-grid { grid-template-columns: 1fr; }
  .arcade { height: 130px; }
  .arc-jet { font-size: 36px; }
  .arc-banner { font-size: 15px; }
  .float-math span { font-size: 30px; }
  .hero-beady { width: 64px; }
  .beady-bubble { font-size: 13px; left: 4px; bottom: 100%; margin: 0 0 6px; }
  .beady-bubble::after { right: auto; left: 18px; bottom: auto; top: 100%; border-right-color: transparent; border-top-color: var(--brand); }
}
@media (prefers-reduced-motion: reduce) {
  .float-math span, .hero-beady img, .arc-plane, .arc-jet, .arc-banner, .arc-alien, .arc-laser, .arc-meteor, .arc-clouds, .arc-stars, .new-tag { animation: none; }
  .arc-plane { translate: 40px 0; }
}

@media (max-width: 900px) {
  .steps::before { display: none; }
  .hero-badge.b1 { left: -8px; }
  .hero-badge.b2 { right: -4px; }
}
@media (max-width: 560px) {
  .home-nav { flex-wrap: nowrap; padding: 8px 12px; }
  .home-nav .logo { font-size: 22px; }
  .home-nav .logo-mark { width: 28px; height: 28px; margin-right: 6px; }
  .nav-cta { gap: 6px; }
  .nav-cta .btn.small { padding: 5px 9px; font-size: 14px; white-space: nowrap; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row b { font-size: 28px; }
  .cta-inner { padding: 24px 20px; }
  .hero-badge { padding: 4px 8px; }
  .hero-badge small { display: none; }
  .hero-badge.b1 { top: -24px; bottom: auto; left: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .float-beads i, .hero-badge, .wa-float { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
