/* ================================================================
   SMART KIDS — Main Stylesheet
   Theme: Sky-blue adventure, cloud-bordered, character-mascot cards
   Fonts: Boogaloo (display) · Bubblegum Sans (taglines) · Baloo 2 (body)
   ================================================================ */

/* ─────────────────────────────────────────
   Reset & Base
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--navy);
  overflow-x: hidden;
  background: #ffffff;
}

img { max-width: 100%; height: auto; display: block; }
a   { text-decoration: none; color: inherit; }

/* ─────────────────────────────────────────
   Floating Nav Island
───────────────────────────────────────── */
.floating-nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.floating-nav.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
}

.nav-logo span {
  background: linear-gradient(120deg, var(--c-memory), var(--c-brain));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-pill {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  padding: 6px 18px;
  border-radius: 30px;
  color: var(--navy);
  transition: background 0.2s, transform 0.2s;
}

.nav-pill:hover,
.nav-pill.active {
  background: var(--yellow);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────
   Hero Section
───────────────────────────────────────── */
.hero-section {
  min-height: 100svh;
  background: linear-gradient(180deg,
    var(--sky-top)  0%,
    var(--sky-mid)  45%,
    var(--sky-light) 80%,
    var(--sky-pale)  100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 0 20px 140px;
}

/* Cloud-shaped bottom border — white SVG clip-path */
.hero-cloud-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 160px;
  pointer-events: none;
  z-index: 10;
}

.hero-cloud-bottom svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ─────────────────────────────────────────
   Clouds (footer only)
───────────────────────────────────────── */

/* Cloud base shape */
.cloud {
  position: absolute;
  background: #fff;
  border-radius: 60px;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 50%;
}

/* Footer clouds */
.cloud-g {
  width: 260px; height: 76px;
  bottom: 0; left: -40px;
  animation: cloudDrift 17s ease-in-out infinite;
  opacity: 0.12;
}
.cloud-g::before { width: 104px; height: 104px; top: -52px; left: 30px; }
.cloud-g::after  { width: 74px;  height: 74px;  top: -37px; left: 115px; }

.cloud-h {
  width: 200px; height: 60px;
  bottom: 0; right: -20px;
  animation: cloudDrift 13s ease-in-out infinite reverse;
  opacity: 0.12;
}
.cloud-h::before { width: 82px; height: 82px; top: -41px; left: 24px; }
.cloud-h::after  { width: 60px; height: 60px; top: -30px; left: 90px; }

@keyframes cloudDrift {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(18px); }
}

/* ─────────────────────────────────────────
   Sun decoration
───────────────────────────────────────── */
.sun-decor {
  position: absolute;
  top: 28px;
  right: 36px;
  font-size: 2.8rem;
  z-index: 2;
  animation: sunSpin 28s linear infinite;
  filter: drop-shadow(0 4px 12px rgba(255,200,0,0.4));
}

@keyframes sunSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────
   Character Parade — row of transparent PNGs
───────────────────────────────────────── */
.character-parade {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 680px;
  margin-top: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
}

.hero-char {
  height: 160px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.18));
  opacity: 0;
  animation: charPop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Centre character stands tallest */
.hero-char--center {
  height: 200px;
  z-index: 2;
}

/* Stagger each kid's entrance */
.hero-char:nth-child(1) { animation-delay: 0.05s; }
.hero-char:nth-child(2) { animation-delay: 0.15s; }
.hero-char:nth-child(3) { animation-delay: 0.25s; }
.hero-char:nth-child(4) { animation-delay: 0.35s; }
.hero-char:nth-child(5) { animation-delay: 0.45s; }

@keyframes charPop {
  from { opacity: 0; transform: translateY(30px) scale(0.85); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

/* ─────────────────────────────────────────
   Brand block
───────────────────────────────────────── */
.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  z-index: 5;
  margin-top: 8px;
}

.brand-emoji {
  font-size: 2.4rem;
  animation: emojiWiggle 2.4s ease-in-out infinite;
  display: inline-block;
}

.brand-emoji:last-child { animation-delay: 0.6s; }

@keyframes emojiWiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25%       { transform: scale(1.18) rotate(-7deg); }
  75%       { transform: scale(1.1)  rotate(6deg); }
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 900;
  letter-spacing: 5px;
  color: #fff;
  line-height: 1;
  text-shadow:
    3px 3px 0 rgba(0, 0, 0, 0.18),
    0 0 40px rgba(255, 255, 255, 0.4);
}

.hero-tagline {
  font-family: var(--font-brand);
  font-size: clamp(1.1rem, 3.2vw, 1.85rem);
  color: rgba(255, 255, 255, 0.94);
  font-style: italic;
  letter-spacing: 1.5px;
  margin-top: 6px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.14);
  position: relative;
  z-index: 5;
}

/* ─────────────────────────────────────────
   Category Cards (A-Z / 0-9)
───────────────────────────────────────── */
.cat-cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 28px;
  width: 100%;
  max-width: 400px;
  position: relative;
  z-index: 5;
}

.cat-card {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 22px;
  padding: 18px 24px;
  cursor: pointer;
  background: var(--yellow);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  min-height: 88px;
  overflow: visible;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}

.cat-card:hover {
  transform: translateY(-7px) scale(1.025);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.az-card  { justify-content: flex-end; }
.num-card { justify-content: flex-start; }

/* Mascots pop out of cards */
.cat-mascot {
  position: absolute;
  bottom: 0;
  height: 118px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
  transition: transform 0.35s ease;
}

.mascot-left  { left: -8px; }
.mascot-right { right: -8px; }

.cat-card:hover .cat-mascot { transform: translateY(-10px); }

.cat-badge {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 8px 30px;
  border-radius: 14px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  color: #fff;
}

.badge-dark { background: var(--navy); }
.badge-red  { background: var(--red-badge); }

/* ─────────────────────────────────────────
   CTA Button
───────────────────────────────────────── */
.hero-cta {
  margin-top: 32px;
  position: relative;
  z-index: 5;
}

.cta-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1rem, 3vw, 1.35rem);
  letter-spacing: 3.5px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 3px solid var(--navy);
  border-radius: 18px;
  padding: 18px 44px;
  cursor: pointer;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.25);
  animation: ctaFloat 2.2s ease-in-out infinite;
  transition: background 0.25s, color 0.25s, transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
  background: var(--navy);
  color: #fff;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.28);
  animation: none;
}

@keyframes ctaFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

/* ─────────────────────────────────────────
   Section Common
───────────────────────────────────────── */
.games-section {
  position: relative;
  padding: 80px 0 110px;
}

.section-header {
  text-align: center;
  margin-bottom: 20px;
}

.section-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 4px;
  padding: 8px 26px;
  border-radius: var(--radius-sm);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.az-badge  { background: var(--navy); }
.num-badge { background: var(--red-badge); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  color: var(--navy);
  margin-top: 14px;
  letter-spacing: 2px;
}

.all-title {
  background: linear-gradient(120deg, var(--c-memory), var(--c-math), var(--c-shape));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-sub {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: #636e72;
  margin-top: 8px;
}

/* ─────────────────────────────────────────
   Section Backgrounds — all white
───────────────────────────────────────── */
.az-section,
.num-section {
  background: #ffffff;
}

.all-section {
  background: #ffffff;
  padding-bottom: 140px;
}

/* ─────────────────────────────────────────
   Games Grid
───────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 175px 24px; /* tall gap to clear the enlarged mascots (2.5×) */
  padding-top: 175px;
}

/* ─────────────────────────────────────────
   Game Card
───────────────────────────────────────── */
.game-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-card);
  overflow: visible; /* mascot pops out */
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  margin-top: 150px; /* offset for mascot overhang (2.5×) */
}

.game-card:hover {
  transform: translateY(-10px) scale(1.025);
  box-shadow: var(--shadow-lift);
}

.game-card:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}

/* Floating mascot above card — 2.5× enlarged */
.game-mascot {
  position: absolute;
  top: -146px;
  right: 10px;
  height: 270px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.18));
  z-index: 10;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.game-card:hover .game-mascot {
  transform: translateY(-16px) scale(1.06);
}

/* Card header (colored gradient) */
.card-header {
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  padding: 22px 20px 18px;
  position: relative;
  overflow: hidden;
  min-height: 96px;
}

/* Decorative circle in header */
.card-header::after {
  content: '';
  position: absolute;
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  top: -40px;
  right: -20px;
}

.card-emoji-ring {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-game-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: #fff;
  margin-top: 10px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.18);
  line-height: 1.1;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.skill-tag {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Card body (white) */
.card-body-content {
  padding: 18px 20px 20px;
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  background: #fff;
}

.card-description {
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: #636e72;
  line-height: 1.55;
  margin-bottom: 14px;
}

/* Difficulty dots */
.difficulty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.diff-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #b2bec3;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.diff-dots {
  display: flex;
  gap: 5px;
}

.diff-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dfe6e9;
  transition: transform 0.2s;
}

.diff-dot.on {
  background: var(--dot-accent, #FFD600);
  transform: scale(1.1);
}

/* Play button */
.play-btn {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-align: center;
  color: #fff;
  background: var(--btn-accent, #FFD600);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.play-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ─────────────────────────────────────────
   Footer
───────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.75);
  position: relative;
  overflow: hidden;
  padding: 80px 24px 48px;
  text-align: center;
}

.footer-clouds {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 90px;
  pointer-events: none;
}

.footer-inner { position: relative; z-index: 2; }

.footer-brand {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--yellow);
  margin-bottom: 6px;
}

.footer-tagline {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 22px;
}

.footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-link {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-link:hover { color: var(--yellow); }

.footer-copy {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ─────────────────────────────────────────
   Sparkle burst (JS-injected)
───────────────────────────────────────── */
@keyframes sparkle-fly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--sx), var(--sy)) scale(0); opacity: 0; }
}

.sparkle-dot {
  position: fixed;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  animation: sparkle-fly 0.65s ease-out forwards;
}

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 576px) {
  .floating-nav .nav-links { display: none; }
  .cat-badge { font-size: 2.2rem; padding: 8px 22px; }
  .cat-mascot { height: 98px; }
  .games-grid { grid-template-columns: 1fr; gap: 120px 0; padding-top: 120px; }
  .game-card { margin-top: 100px; }
  .game-mascot { height: 180px; top: -110px; }
  .hero-section { padding-bottom: 110px; }
  .hero-char { height: 100px; }
  .hero-char--center { height: 126px; }
}

@media (min-width: 768px) {
  .cat-cards-wrapper { max-width: 460px; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (min-width: 1200px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
