/* Kids' learning site — bright, friendly, built for 6–8 year-olds.
   Big type, big tap targets, high contrast. Vanilla CSS, no dependencies. */

:root {
  --bg: #fff7ec;
  --bg-2: #ffeede;
  --ink: #2b2440;
  --ink-soft: #6b6480;
  --card: #ffffff;
  --purple: #9b6cff;
  --purple-dark: #7a4fe0;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(43, 36, 64, 0.10);
  --font: "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

/* ---------- Header ---------- */
.site-header { text-align: center; padding: 1.5rem 0 0.5rem; }
.site-header .logo { font-size: 3.5rem; line-height: 1; }
.site-header h1 { font-size: 2.4rem; margin: 0.3rem 0 0.1rem; }
.site-header .tagline { color: var(--ink-soft); font-size: 1.15rem; margin: 0; }

/* ---------- Subject sections ---------- */
.subject { margin-top: 2.2rem; }
.subject-head {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.5rem; font-weight: 800; margin: 0 0 1rem;
}
.subject-head .dot { width: 1.4rem; height: 1.4rem; border-radius: 50%; flex: none; }

/* ---------- Lesson tiles ---------- */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}
.lesson-tile {
  position: relative;
  display: flex; flex-direction: column;
  text-decoration: none; color: var(--ink);
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.4rem 1.2rem 1.3rem;
  box-shadow: var(--shadow);
  border: 4px solid transparent;
  transition: transform 0.08s ease;
  min-height: 150px;
}
.lesson-tile:hover, .lesson-tile:focus-visible { transform: translateY(-4px); outline: none; }
.lesson-tile:active { transform: translateY(0); }
.lesson-tile .emoji { font-size: 2.8rem; line-height: 1; }
.lesson-tile h3 { font-size: 1.25rem; margin: 0.6rem 0 0.25rem; }
.lesson-tile .blurb { color: var(--ink-soft); font-size: 1rem; margin: 0; flex: 1; }
.lesson-tile .star {
  position: absolute; top: 0.7rem; right: 0.8rem;
  font-size: 1.6rem; filter: drop-shadow(0 2px 3px rgba(0,0,0,.15));
}

/* ---------- Lesson page ---------- */
.lesson-top { display: flex; align-items: center; gap: 0.8rem; margin: 0.5rem 0 1rem; }
.back-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  text-decoration: none; font-weight: 800; font-size: 1.05rem;
  color: var(--purple-dark);
  background: #fff; border-radius: 999px; padding: 0.6rem 1.1rem; box-shadow: var(--shadow);
}
.lesson-title { text-align: center; margin: 0.2rem 0 0.3rem; font-size: 2rem; }
.lesson-instructions { text-align: center; color: var(--ink-soft); font-size: 1.15rem; margin: 0 0 1.1rem; }

.activity-frame {
  width: 100%; height: 70vh; min-height: 420px;
  border: none; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); display: block;
}

.lesson-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.8rem; margin-top: 1.2rem; flex-wrap: wrap;
}
.btn {
  font-family: var(--font); font-size: 1.1rem; font-weight: 800;
  border: none; border-radius: 16px; padding: 0.8rem 1.3rem; cursor: pointer;
  color: var(--ink); background: #fff; box-shadow: var(--shadow);
  text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn[disabled] { opacity: 0.4; cursor: default; pointer-events: none; }
.btn-done { color: #fff; background: #34c77b; box-shadow: 0 6px 0 #27a263; transition: transform 0.05s; }
.btn-done:active { transform: translateY(3px); box-shadow: 0 3px 0 #27a263; }
.btn-done.is-done { background: #b9b4c7; box-shadow: 0 6px 0 #9a93ab; }

/* ---------- Celebration ---------- */
.cheer {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; pointer-events: none;
}
.cheer.show { display: flex; }
.cheer .cheer-msg {
  background: #fff; border-radius: 28px; padding: 2rem 2.4rem; text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.2);
}
.cheer .cheer-msg .big { font-size: 4rem; }
.cheer .cheer-msg h2 { margin: 0.4rem 0 0; font-size: 1.8rem; }

/* ---------- Misc ---------- */
.note { text-align: center; color: var(--ink-soft); font-size: 1.1rem; padding: 2rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
