/* Leo's Learning Adventures — Main Stylesheet */

/* ============================================================
   Léo's Learning Adventures — Main Stylesheet
   Style Concept: Storybook Sunshine — warm, saturated, joyful
   Fonts: Baloo 2 (headings), Nunito (body)
   ============================================================ */

/* ---- CSS VARIABLES ---- */
:root {
  /* Category palette */
  --color-letters:    #FF6B6B;
  --color-letters-2:  #FF9F9F;
  --color-numbers:    #FF9F1C;
  --color-numbers-2:  #FFCF77;
  --color-shapes:     #6BCB77;
  --color-shapes-2:   #A8E6AD;
  --color-animals:    #4D96FF;
  --color-animals-2:  #9DC8FF;
  --color-challenges: #B57BEE;
  --color-challenges-2:#D5ACFF;

  /* Brand */
  --brand-yellow:  #FFD60A;
  --brand-orange:  #FF9F1C;
  --brand-sky:     #C8E6FF;
  --brand-grass:   #D4F0A0;
  --bg-top:        #FFF9EE;
  --bg-bottom:     #E8F7FF;

  /* Text */
  --text-dark:     #2D2D2D;
  --text-mid:      #5A5A6A;
  --text-light:    #FFFFFF;

  /* Misc */
  --radius-card:   24px;
  --radius-btn:    50px;
  --shadow-soft:   0 8px 32px rgba(0,0,0,0.10);
  --shadow-pop:    0 12px 40px rgba(0,0,0,0.16);
  --transition:    0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
  color: var(--text-dark);
  overflow-x: hidden;
  position: relative;
}

/* ---- ACCESSIBILITY ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

a:focus-visible, button:focus-visible {
  outline: 3px solid var(--brand-yellow);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---- LANGUAGE TOGGLE ---- */
.hidden { display: none !important; }

/* ============================================================
   DECORATIVE BACKGROUND
   ============================================================ */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud { position: absolute; font-size: 3rem; opacity: 0.45; }
.cloud-1 { top: 6%;  left: -4%;  font-size: 4rem; }
.cloud-2 { top: 12%; right: -2%; font-size: 3.2rem; }
.cloud-3 { top: 2%;  left: 35%;  font-size: 2.8rem; }

.star { position: absolute; }
.star-1 { top: 8%;  left: 15%;  font-size: 1.6rem; animation-delay: 0s; }
.star-2 { top: 15%; right: 18%; font-size: 1.2rem; animation-delay: -0.8s; }
.star-3 { top: 5%;  right: 38%; font-size: 1.4rem; animation-delay: -1.6s; }
.star-4 { top: 22%; left: 60%;  font-size: 1rem;   animation-delay: -0.4s; }

.tree { position: fixed; bottom: 0; font-size: 5rem; opacity: 0.7; line-height: 1; }
.tree-left  { left: 1%; }
.tree-right { right: 1%; }

.sun    { position: fixed; top: 3%; right: 5%; font-size: 3.8rem; opacity: 0.8; }
.sun-halo {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,10,0.30) 0%, rgba(255,180,0,0.14) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

/* ---- Background animations ---- */
@keyframes floatCloud {
  0%, 100% { transform: translateX(0) translateY(0); }
  40%       { transform: translateX(30px) translateY(-8px); }
  70%       { transform: translateX(-15px) translateY(5px); }
}
@keyframes twinkle {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.55; }
}
@keyframes sunSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: relative;
  z-index: 10;
  padding: 1rem 1.5rem 0.5rem;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-btn);
  padding: 0.3rem 0.8rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  align-self: flex-end;
}

.lang-btn {
  background: none;
  border: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-btn);
  transition: background 0.2s, color 0.2s;
}
.lang-btn.active {
  background: var(--brand-yellow);
  color: var(--text-dark);
}
.lang-btn:hover:not(.active) { background: rgba(255,214,10,0.25); }
.lang-divider { color: #ccc; font-weight: 300; }

/* Logo block */
.logo-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.logo-icon {
  font-size: 4rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
  /* no continuous animation */
  line-height: 1;
}

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

.logo-text { display: flex; flex-direction: column; }

.site-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #FF6B6B, #FF9F1C, #FFD60A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  letter-spacing: -0.5px;
}

.site-tagline {
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--text-mid);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  padding: 2rem 0 1.5rem;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Leo container */
.leo-container { flex-shrink: 0; }

.leo-img {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.leo-placeholder {
  width: 160px;
  height: 160px;
  background: linear-gradient(135deg, #FFD60A, #FF9F1C);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(255,159,28,0.4), 0 0 0 6px rgba(255,214,10,0.3);

  cursor: default;
  /* Replace with: overflow: hidden; and <img> tag */
}

.leo-face  { font-size: 5rem; line-height: 1; display: block; }
.leo-name  {
  font-family: 'Baloo 2', cursive;
  font-size: 1rem; font-weight: 800;
  color: white; text-shadow: 0 1px 4px rgba(0,0,0,0.2);
  margin-top: -4px;
}

@keyframes leoPulse {
  0%, 100% { transform: scale(1) translateY(0); }
  50%       { transform: scale(1.04) translateY(-4px); }
}

/* Speech bubble */
.leo-speech-bubble {
  position: relative;
  margin-top: 12px;
  background: white;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  text-align: center;
  max-width: 220px;
}
.leo-speech-bubble::before {
  content: '';
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: white;
}

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

/* Hero text */
.hero-text {
  flex: 1;
  min-width: 260px;
  text-align: center;
}

.hero-heading {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--text-mid);
  font-weight: 600;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

/* Dot row */
.dot-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.dot {
  display: inline-block;
  width: 14px; height: 14px;
  border-radius: 50%;
}
.dot-yellow  { background: #FFD60A; }
.dot-pink    { background: #FF6B6B; }
.dot-blue    { background: #4D96FF; }
.dot-green   { background: #6BCB77; }
.dot-orange  { background: #FF9F1C; }

@keyframes dotBounce {
  0%, 100% { transform: translateY(0); }
  40%       { transform: translateY(-8px); }
}

/* ============================================================
   CATEGORIES GRID
   ============================================================ */
.categories-section {
  padding: 1rem 0 2rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.4rem;
}

/* Individual card */
.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text-light);
  border-radius: var(--radius-card);
  padding: 2rem 1.25rem 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  /* No entrance animation — static display */
}






@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(40px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hover / focus */
.category-card:hover,
.category-card:focus-visible {
  transform: translateY(-8px) scale(1.03);
  box-shadow: var(--shadow-pop);
}

/* Glow layer */
.card-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.category-card:hover .card-glow { opacity: 1; }

/* Corner badge */
.card-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 1.3rem;
  opacity: 0.9;
  animation: none;
}
@keyframes badgeSpin {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2) translateY(-2px); }
}

/* Main icon */
.card-icon {
  font-size: 3.8rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  transition: transform var(--transition);
  line-height: 1;
}
.category-card:hover .card-icon { transform: scale(1.18) translateY(-3px); }

/* Card text */
.card-title {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 800;
  margin-bottom: 0.35rem;
  line-height: 1.2;
}
.card-desc {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 1rem;
  line-height: 1.4;
}
.card-cta {
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-btn);
  padding: 0.35rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: 2px solid rgba(255,255,255,0.5);
  transition: background 0.2s, transform 0.15s;
}
.category-card:hover .card-cta {
  background: rgba(255,255,255,0.45);
  transform: scale(1.05);
}

/* ---- Per-card colors ---- */
.card-letters {
  background: linear-gradient(145deg, var(--color-letters), var(--color-letters-2));
}
.card-letters .card-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.35), transparent 70%);
}

.card-numbers {
  background: linear-gradient(145deg, var(--color-numbers), var(--color-numbers-2));
}
.card-numbers .card-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.35), transparent 70%);
}

.card-shapes {
  background: linear-gradient(145deg, var(--color-shapes), var(--color-shapes-2));
}
.card-shapes .card-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.35), transparent 70%);
}

.card-animals {
  background: linear-gradient(145deg, var(--color-animals), var(--color-animals-2));
}
.card-animals .card-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.35), transparent 70%);
}

.card-challenges {
  background: linear-gradient(145deg, var(--color-challenges), var(--color-challenges-2));
}
.card-challenges .card-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.35), transparent 70%);
}



/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  position: relative;
  z-index: 5;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border-top: 2px solid rgba(255,214,10,0.3);
  padding: 1.5rem 1.5rem 2rem;
  text-align: center;
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.footer-logo { font-size: 2rem; }

.footer-copy {
  font-size: 0.82rem;
  color: var(--text-mid);
  font-weight: 600;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-link:hover { color: var(--color-letters); }

/* ============================================================
   RESPONSIVE — TABLET (≥ 640px)
   ============================================================ */
@media (min-width: 640px) {
  .header-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .lang-toggle { align-self: auto; order: 1; }
  .logo-block   { order: 0; }

  .leo-placeholder { width: 180px; height: 180px; }
  .leo-face         { font-size: 6rem; }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  /* Last row: 2 cards centered */
  .category-card:nth-child(4),
  .category-card:nth-child(5) {
    grid-column: span 1;
  }
  /* 5th card: nudge to center */
  .categories-grid .category-card:last-child:nth-child(3n+2) {
    /* skip – handled below */
  }
}

/* ============================================================
   RESPONSIVE — DESKTOP (≥ 900px)
   ============================================================ */
@media (min-width: 900px) {
  .categories-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .hero-inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 3rem;
  }

  .hero-text { text-align: left; }
  .dot-row   { justify-content: flex-start; }

  .leo-placeholder { width: 200px; height: 200px; }
  .leo-face         { font-size: 7rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .category-card:hover { transform: translateY(-4px); }
}


/* ---- MUTE BUTTON ---- */
.mute-btn {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: var(--radius-btn);
  padding: 0.3rem 0.75rem;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: background 0.2s, transform 0.15s;
  line-height: 1;
}
.mute-btn:hover { background: rgba(255,255,255,1); transform: scale(1.1); }
.mute-btn.muted { background: rgba(255,100,100,0.15); }