/* ============================================================
   Spotlings web — brand palette drawn from the app's feature
   graphic: purple → pink → peach gradients, Pip yellow accents.
   Fredoka for display (matches the bubbly logo), Nunito for body.
   ============================================================ */

:root {
  --purple: #7c4dff;
  --purple-deep: #5b2fd1;
  --purple-ink: #3a2c6e;
  --purple-soft: #f3edff;
  --pink: #ff7ac3;
  --pink-soft: #ffe3f2;
  --peach: #ffc59a;
  --peach-soft: #fff1e4;
  --yellow: #ffd43b;
  --orange: #ff9f43;
  --green: #4cd964;
  --ink: #2d2440;
  --ink-soft: #6f6588;
  --bg: #fffaf6;
  --card: #ffffff;
  --border: #efe7f7;
  --shadow-sm: 0 4px 14px rgba(90, 60, 160, 0.10);
  --shadow-md: 0 12px 34px rgba(90, 60, 160, 0.16);
  --shadow-lg: 0 24px 60px rgba(90, 60, 160, 0.22);
  --r-sm: 14px;
  --r-md: 22px;
  --r-lg: 32px;
  --font-display: 'Fredoka', 'Nunito', sans-serif;
  --font-body: 'Nunito', -apple-system, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, .display { font-family: var(--font-display); }

/* ============ scroll reveal ============ */
/* Hidden state is gated on html.js (set by an inline script) so content is
   never invisible if JavaScript fails to load. */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; }
}

/* ============ nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 246, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(124, 77, 255, 0.10);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.nav-brand span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--purple-ink);
  letter-spacing: 0.2px;
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--purple); }
.nav-cta {
  background: var(--purple);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 9999px;
  box-shadow: 0 6px 18px rgba(124, 77, 255, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(124, 77, 255, 0.45); }
@media (max-width: 720px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ============ hero ============ */
.hero {
  position: relative;
  background: linear-gradient(135deg, #8f6bff 0%, #b47aff 34%, #f099d8 68%, #ffcf9e 100%);
  overflow: hidden;
  padding: 84px 0 110px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 32px;
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: 9999px;
  backdrop-filter: blur(6px);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 3.9rem);
  font-weight: 700;
  line-height: 1.08;
  color: #fff;
  letter-spacing: -0.5px;
  text-shadow: 0 3px 24px rgba(80, 40, 160, 0.25);
}
.hero h1 .pop {
  color: var(--yellow);
  text-shadow: 0 3px 0 rgba(180, 110, 0, 0.25);
}
.hero p.sub {
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  max-width: 480px;
  margin: 18px 0 30px;
}
.hero-ctas { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.btn-store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #1a1130;
  color: #fff;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-store:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-lg); }
.btn-store svg { width: 30px; height: 30px; }
.btn-store .lines { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.btn-store .small { font-size: 0.68rem; font-weight: 700; opacity: 0.8; letter-spacing: 1px; text-transform: uppercase; }
.btn-store .big { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  padding: 13px 24px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  transition: background 0.2s, transform 0.2s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }

.hero-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.chip {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 7px 15px;
  border-radius: 9999px;
  backdrop-filter: blur(4px);
}

/* pip side */
.hero-pip {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-pip .blob {
  position: absolute;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.55), rgba(255,255,255,0.08) 65%);
  border-radius: 46% 54% 58% 42% / 48% 44% 56% 52%;
  animation: blob-morph 9s ease-in-out infinite alternate;
}
.hero-pip img {
  position: relative;
  width: min(330px, 72vw);
  filter: drop-shadow(0 24px 40px rgba(70, 30, 140, 0.35));
  animation: pip-bob 3.4s ease-in-out infinite;
}
@keyframes pip-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-18px) rotate(2deg); }
}
@keyframes blob-morph {
  0% { border-radius: 46% 54% 58% 42% / 48% 44% 56% 52%; transform: rotate(0deg) scale(1); }
  100% { border-radius: 54% 46% 42% 58% / 44% 56% 48% 52%; transform: rotate(8deg) scale(1.06); }
}

/* floating decorations */
.float-deco {
  position: absolute;
  font-size: 2rem;
  opacity: 0.85;
  pointer-events: none;
  animation: deco-float 6s ease-in-out infinite;
  filter: drop-shadow(0 6px 12px rgba(70, 30, 140, 0.25));
  z-index: 1;
}
@keyframes deco-float {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-22px) rotate(6deg); }
}

/* wavy bottom edge of hero */
.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  z-index: 3;
  display: block;
}
.hero-wave svg { display: block; width: 100%; height: 70px; }

@media (max-width: 860px) {
  .hero { padding: 56px 0 96px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p.sub { margin-left: auto; margin-right: auto; }
  .hero-ctas, .hero-chips { justify-content: center; }
  .hero-pip { margin-top: 34px; }
  .hero-pip .blob { width: 300px; height: 300px; }
}

/* ============ sections ============ */
section { padding: 84px 0; }
.sec-eyebrow {
  display: inline-block;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--purple-soft);
  padding: 7px 16px;
  border-radius: 9999px;
  margin-bottom: 14px;
}
.sec-title {
  font-size: clamp(1.9rem, 3.8vw, 2.7rem);
  font-weight: 700;
  color: var(--purple-ink);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 12px;
}
.sec-sub { color: var(--ink-soft); font-size: 1.08rem; font-weight: 600; max-width: 620px; }
.sec-head.center { text-align: center; }
.sec-head.center .sec-sub { margin: 0 auto; }

/* ============ game tiles grid ============ */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 44px;
}
.tile {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px 22px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s, border-color 0.25s;
}
.tile:hover {
  transform: translateY(-6px) rotate(-0.5deg);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.tile .ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 14px;
}
.tile:nth-child(6n+1) .ico { background: var(--purple-soft); }
.tile:nth-child(6n+2) .ico { background: var(--pink-soft); }
.tile:nth-child(6n+3) .ico { background: var(--peach-soft); }
.tile:nth-child(6n+4) .ico { background: #e8fbe9; }
.tile:nth-child(6n+5) .ico { background: #e6f5ff; }
.tile:nth-child(6n+6) .ico { background: #fff8dc; }
.tile h3 { font-size: 1.12rem; font-weight: 600; color: var(--purple-ink); margin-bottom: 5px; }
.tile p { font-size: 0.9rem; color: var(--ink-soft); font-weight: 600; line-height: 1.5; }

/* ============ feature banner ============ */
.feature-banner { padding: 20px 0 84px; }
.feature-banner img {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.feature-banner img:hover { transform: scale(1.015) rotate(-0.4deg); }

/* ============ play corner (browser games) ============ */
.play-corner {
  background:
    radial-gradient(900px 380px at 85% -10%, rgba(124, 77, 255, 0.10), transparent),
    radial-gradient(700px 340px at 8% 110%, rgba(255, 122, 195, 0.10), transparent),
    var(--purple-soft);
  border-radius: var(--r-lg);
  padding: 56px 0 !important;
  margin: 0 16px;
}
.play-corner > .inner { max-width: 900px; margin: 0 auto; padding: 0 24px; }

.game-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 36px 0 22px;
}
.game-tab {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--purple-ink);
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 9999px;
  padding: 11px 24px;
  cursor: pointer;
  transition: all 0.2s;
}
.game-tab:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.game-tab.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 77, 255, 0.35);
}

.game-stage {
  position: relative;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: 480px;
}
.game-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  z-index: 5;
  pointer-events: none;
}
.game-hud .hud-pill {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--border);
  border-radius: 9999px;
  padding: 6px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple-ink);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.game-board { position: absolute; inset: 0; }

/* start / win overlays */
.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(58, 44, 110, 0.55);
  backdrop-filter: blur(6px);
  text-align: center;
  padding: 24px;
}
.game-overlay img { width: 110px; animation: pip-bob 3s ease-in-out infinite; }
.game-overlay h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}
.game-overlay p { color: rgba(255,255,255,0.9); font-weight: 700; max-width: 380px; }
.btn-play {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--purple-ink);
  background: var(--yellow);
  border: none;
  border-radius: 9999px;
  padding: 14px 40px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255, 170, 0, 0.45);
  transition: transform 0.18s, box-shadow 0.18s;
}
.btn-play:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 28px rgba(255, 170, 0, 0.55); }

/* bubble pop */
.bp-board { background: linear-gradient(180deg, #dff1ff 0%, #f2eaff 100%); cursor: pointer; }
.bubble {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset -6px -8px 18px rgba(120, 80, 200, 0.18), inset 6px 8px 14px rgba(255, 255, 255, 0.75), 0 8px 18px rgba(90, 60, 160, 0.14);
  transition: transform 0.12s;
  will-change: transform;
}
.bubble:hover { transform: scale(1.06); }
.bubble.popped { animation: bubble-pop 0.24s ease-out forwards; }
@keyframes bubble-pop {
  40% { transform: scale(1.45); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* animal boop */
.ab-board {
  background: linear-gradient(180deg, #fff6e3 0%, #ffeef7 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4%;
  padding: 64px 8% 8%;
}
.pod {
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 -8px 16px rgba(90, 60, 160, 0.12), 0 6px 14px rgba(90, 60, 160, 0.12);
  user-select: none;
  -webkit-user-select: none;
}
.pod .critter {
  font-size: clamp(2rem, 7vw, 3.4rem);
  transform: scale(0);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 6px rgba(90, 60, 160, 0.25));
}
.pod.up .critter { transform: scale(1); }
.pod.booped .critter { animation: boop-squish 0.3s ease-out; }
@keyframes boop-squish {
  40% { transform: scale(1.35, 0.7); }
  100% { transform: scale(0); }
}

/* memory match */
.mm-board {
  background: linear-gradient(180deg, #f3edff 0%, #ffeef7 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3%;
  padding: 64px 6% 6%;
}
.mcard { perspective: 600px; cursor: pointer; }
.mcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.mcard.flipped .mcard-inner { transform: rotateY(180deg); }
.mcard-face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: clamp(1.5rem, 5vw, 2.6rem);
}
.mcard-back {
  background: linear-gradient(135deg, #9d7bff, #7c4dff);
  box-shadow: 0 6px 14px rgba(90, 60, 160, 0.22);
}
.mcard-back::after {
  content: '?';
  font-family: var(--font-display);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.6rem;
}
.mcard-front {
  background: #fff;
  border: 3px solid var(--border);
  transform: rotateY(180deg);
}
.mcard.matched .mcard-front {
  border-color: var(--green);
  background: #f0fff2;
  animation: match-glow 0.5s ease-out;
}
@keyframes match-glow {
  40% { transform: rotateY(180deg) scale(1.1); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* confetti */
.confetti-bit {
  position: absolute;
  width: 10px;
  height: 14px;
  top: -20px;
  z-index: 9;
  pointer-events: none;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(560px) rotate(720deg); opacity: 0.2; }
}

@media (max-width: 640px) {
  .game-stage { height: 420px; }
  .ab-board { padding-top: 58px; }
  .mm-board { padding-top: 58px; }
}

/* ============ privacy pledge ============ */
.pledge-card {
  background: linear-gradient(135deg, #6a3df5 0%, #9c4dff 55%, #c86bff 100%);
  border-radius: var(--r-lg);
  padding: 56px 48px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.pledge-card::before {
  content: '';
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -140px; right: -100px;
}
.pledge-card h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 700; margin-bottom: 10px; }
.pledge-card > p { color: rgba(255, 255, 255, 0.88); font-weight: 600; max-width: 560px; margin-bottom: 34px; }
.pledge-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}
.stat {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--r-md);
  padding: 20px 18px;
  backdrop-filter: blur(4px);
}
.stat .num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--yellow); line-height: 1; }
.stat .lbl { font-size: 0.86rem; font-weight: 800; color: rgba(255, 255, 255, 0.85); margin-top: 6px; }
.btn-light {
  display: inline-block;
  background: #fff;
  color: var(--purple-deep);
  text-decoration: none;
  font-weight: 800;
  padding: 13px 30px;
  border-radius: 9999px;
  box-shadow: 0 8px 22px rgba(30, 10, 80, 0.3);
  transition: transform 0.2s;
}
.btn-light:hover { transform: translateY(-3px); }

/* ============ download band ============ */
.dl-band { text-align: center; padding-bottom: 100px; }
.dl-band .pip-peek { width: 130px; margin: 0 auto 8px; animation: pip-bob 3.2s ease-in-out infinite; }
.dl-band h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); font-weight: 700; color: var(--purple-ink); margin-bottom: 10px; }
.dl-band p { color: var(--ink-soft); font-weight: 600; margin-bottom: 30px; }
.dl-band .btn-store { background: var(--purple-ink); }

/* ============ footer ============ */
footer {
  background: #241a3d;
  color: rgba(255, 255, 255, 0.75);
  padding: 44px 0;
}
footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand img { width: 34px; height: 34px; border-radius: 10px; }
.foot-brand span { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: #fff; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer a { color: rgba(255, 255, 255, 0.75); text-decoration: none; font-weight: 700; font-size: 0.92rem; }
footer a:hover { color: var(--yellow); }
footer .copy { font-size: 0.85rem; width: 100%; text-align: center; margin-top: 18px; color: rgba(255,255,255,0.45); }

/* ============ policy page ============ */
.policy { padding: 56px 0 80px; }
.policy h1 { font-size: 2.2rem; font-weight: 700; color: var(--purple-ink); margin-bottom: 4px; }
.policy .updated { color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; margin-bottom: 32px; }
.policy h2 { font-size: 1.3rem; font-weight: 600; color: var(--purple-deep); margin: 34px 0 10px; }
.policy p, .policy li { color: var(--ink); font-size: 1.02rem; margin-bottom: 10px; }
.policy ul { padding-left: 24px; margin-bottom: 12px; }
.policy .highlight {
  background: var(--purple-soft);
  border-left: 5px solid var(--purple);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 22px 0;
  font-weight: 700;
  color: var(--purple-ink);
}
.policy a { color: var(--purple-deep); font-weight: 700; }
