/* LearnAI: system fonts only, so no request ever leaves for another website. */
:root {
  --bg: #f6f4ff;
  --bg-dots: #e6e1ff;
  --card: #ffffff;
  --card-2: #f1eeff;
  --line: #e1dcf5;
  --text: #1f1a3d;
  --muted: #5f5a7d;
  --accent: #5b5bd6;
  --accent-ink: #ffffff;
  --sun: #ffb020;
  --ok: #138a5b;
  --ok-bg: #dcf7ea;
  --bad: #c2353b;
  --bad-bg: #fde4e4;
  --shadow: 0 10px 30px #3b2f8a1a;
  --radius: 22px;
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", "Nunito", system-ui, -apple-system, sans-serif;
  /* one colour per lesson */
  --l1: #7c5cff; --l2: #f0563d; --l3: #1aa5c4; --l4: #16a06b; --l5: #e0458f; --l6: #e69500;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141226; --bg-dots: #1f1c3a; --card: #1e1b36; --card-2: #272347; --line: #34305a;
    --text: #f3f1ff; --muted: #b4aed6; --accent: #8b8bff; --accent-ink: #12102a;
    --ok: #4ade9b; --ok-bg: #12382a; --bad: #ff8a8f; --bad-bg: #431d22; --shadow: 0 10px 30px #0006;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141226; --bg-dots: #1f1c3a; --card: #1e1b36; --card-2: #272347; --line: #34305a;
  --text: #f3f1ff; --muted: #b4aed6; --accent: #8b8bff; --accent-ink: #12102a;
  --ok: #4ade9b; --ok-bg: #12382a; --bad: #ff8a8f; --bad-bg: #431d22; --shadow: 0 10px 30px #0006;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--text);
  font: 17px/1.55 var(--font);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }
main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 8px 16px 56px; }
main:focus { outline: none; }

/* ---------- header ---------- */
#site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  width: 100%; max-width: 1040px; margin: 0 auto; padding: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand strong { font-size: 22px; font-weight: 800; letter-spacing: -.2px; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: -3px; }
nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 11px; border-radius: 12px; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--text); background: var(--card-2); }
.lang-switch { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-left: 4px; }
.lang-switch button { border: 0; background: none; color: var(--muted); font-weight: 800; font-size: 13px; padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- shared ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 16px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 0 #0002; transition: transform .08s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #0002; }
.btn.ghost { background: var(--card-2); color: var(--text); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--card-2); color: var(--muted); }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center; padding: 20px 0 28px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); font-weight: 900; letter-spacing: -1px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 19px; color: var(--muted); margin: 14px 0 22px; max-width: 34em; }
.bit { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bubble { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow); font-size: 15px; max-width: 320px; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 16px; height: 16px; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.bit-robot { width: 150px; height: auto; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }

.progress { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-weight: 800; }
.progress-bar { flex: 1; max-width: 280px; height: 12px; background: var(--card-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--l5)); border-radius: 99px; transition: width .4s; }

.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.lesson-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; color: var(--text); text-decoration: none; overflow: hidden; transition: transform .12s; }
.lesson-card:hover { transform: translateY(-3px); }
.lesson-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--c); }
.lesson-card .icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.lesson-card h3 { font-size: 21px; font-weight: 900; }
.lesson-card p { margin: 0; color: var(--muted); flex: 1; }
.lesson-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.lesson-card .go { font-weight: 800; color: var(--c); }
.lesson-card .done-badge { position: absolute; top: 18px; right: 18px; font-size: 13px; font-weight: 800; background: var(--ok-bg); color: var(--ok); padding: 4px 10px; border-radius: 99px; }

/* ---------- lesson ---------- */
.lesson-head { display: flex; gap: 18px; align-items: center; padding: 12px 0 22px; }
.lesson-head .icon { flex: none; width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; font-size: 42px; background: var(--c); box-shadow: var(--shadow); }
.lesson-head h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 900; }
.lesson-head p { margin: 4px 0 0; color: var(--muted); font-size: 18px; }
.back { display: inline-flex; gap: 6px; font-weight: 800; text-decoration: none; color: var(--muted); margin-top: 4px; }
.back:hover { color: var(--text); }

.section { margin: 0 0 26px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: 1.2px; color: var(--c); margin: 0 0 12px; }
.section-title::after { content: ""; flex: 1; height: 2px; background: color-mix(in srgb, var(--c) 25%, transparent); border-radius: 2px; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.learn-card { padding: 18px; }
.learn-card .emoji { font-size: 34px; line-height: 1; }
.learn-card h3 { font-size: 18px; font-weight: 900; margin: 10px 0 6px; }
.learn-card p { margin: 0; color: var(--muted); font-size: 16px; }

.activity { padding: 24px; border: 2px solid color-mix(in srgb, var(--c) 45%, var(--line)); }
.activity h2 { font-size: 24px; font-weight: 900; }
.activity > .intro { color: var(--muted); margin: 6px 0 18px; }
.round-label { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.dots { display: flex; gap: 6px; margin-bottom: 14px; }
.dots span { width: 28px; height: 8px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); }
.dots span.on { background: var(--c); border-color: transparent; }
.dots span.good { background: var(--ok); border-color: transparent; }
.dots span.miss { background: var(--bad); border-color: transparent; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.choice {
  text-align: left; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card-2);
  font-weight: 800; font-size: 17px; cursor: pointer; transition: border-color .1s, transform .08s;
}
.choice:hover:not(:disabled) { border-color: var(--c); transform: translateY(-1px); }
.choice:disabled { cursor: default; }
.choice.right { border-color: var(--ok); background: var(--ok-bg); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); }
.choice.dim { opacity: .55; }

.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: var(--card-2); display: grid; gap: 4px; animation: pop .25s ease-out; }
.feedback strong { font-size: 18px; }
.feedback.good strong { color: var(--ok); }
.feedback.miss strong { color: var(--bad); }
.feedback p { margin: 0; }
.feedback .row { margin-top: 8px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* predict */
.sentence { font-size: clamp(22px, 4vw, 30px); font-weight: 900; margin: 6px 0 16px; }
.sentence mark { background: color-mix(in srgb, var(--c) 22%, transparent); color: inherit; padding: 0 8px; border-radius: 10px; }
.bars { display: grid; gap: 8px; margin-top: 10px; }
.bar { display: grid; grid-template-columns: 120px 1fr 46px; gap: 10px; align-items: center; font-weight: 800; font-size: 15px; }
.bar .track { height: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; width: 0; background: var(--c); border-radius: 99px; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.bar.top { color: var(--c); }
.bar .num { text-align: right; font-variant-numeric: tabular-nums; }

/* chat look (spot + prompt) */
.chat { display: grid; gap: 10px; }
.msg { max-width: 92%; padding: 12px 16px; border-radius: 18px; }
.msg .who { display: block; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; opacity: .75; margin-bottom: 4px; }
.msg.user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.msg.bot { justify-self: start; background: var(--card-2); border-bottom-left-radius: 6px; }
.sentences { display: grid; gap: 8px; margin-top: 4px; }
.sentences .choice { font-weight: 700; background: var(--card); }

/* sort */
.sort-card { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 20px; background: var(--card-2); margin-bottom: 14px; }
.sort-card .emoji { font-size: 44px; line-height: 1; }
.sort-card .text { font-size: 22px; font-weight: 900; }
.sort-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sort-buttons .choice { text-align: center; font-size: 19px; }
.scenario { display: flex; gap: 14px; align-items: flex-start; font-size: 19px; font-weight: 700; margin-bottom: 16px; }
.scenario .emoji { font-size: 40px; line-height: 1; }

/* prompt builder */
.prompt-box { padding: 14px 16px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 19px; min-height: 56px; }
.prompt-box .add { opacity: .85; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.group h4 { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 2px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 7px 13px; font-weight: 700; font-size: 15px; cursor: pointer; }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 18%, var(--card)); border-color: var(--c); }
.stars { font-size: 26px; letter-spacing: 2px; }
.stars .off { opacity: .25; filter: grayscale(1); }
.bot-answer { min-height: 90px; }
.bot-answer p { margin: 0 0 6px; }
.bot-answer .ask { font-style: italic; opacity: .85; }

.remember { padding: 20px; display: grid; gap: 10px; }
.remember ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.remember li { display: flex; gap: 10px; font-weight: 700; font-size: 18px; }
.remember li::before { content: "✓"; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-size: 14px; font-weight: 900; }
.talk { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; background: color-mix(in srgb, var(--c) 10%, var(--card)); }
.talk .emoji { font-size: 30px; line-height: 1; }
.talk p { margin: 0; font-weight: 700; }

.badge-earned { text-align: center; padding: 26px 20px; display: grid; gap: 8px; justify-items: center; animation: pop .35s ease-out; }
.badge-medal { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; font-size: 52px; background: radial-gradient(circle at 35% 30%, #fff8, transparent 50%), var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent), var(--shadow); }
.badge-earned h2 { font-size: 26px; font-weight: 900; }
.locked-note { text-align: center; color: var(--muted); font-weight: 700; padding: 10px; }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti span { position: absolute; top: -40px; font-size: 26px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ---------- diploma ---------- */
.diploma { position: relative; text-align: center; padding: 40px 24px; margin: 10px auto 20px; max-width: 760px; border: 3px solid var(--sun); background: radial-gradient(600px 300px at 50% 0%, color-mix(in srgb, var(--sun) 16%, transparent), transparent), var(--card); }
.diploma .ribbon { font-size: 56px; }
.diploma h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 900; margin: 6px 0 18px; }
.diploma .name { font-size: clamp(26px, 5vw, 38px); font-weight: 900; color: var(--accent); border-bottom: 3px dashed var(--line); display: inline-block; padding: 0 12px 4px; min-width: 60%; }
.diploma .text { font-size: 20px; font-weight: 700; margin: 14px 0 6px; }
.medals { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 22px 0 8px; }
.medal { display: grid; justify-items: center; gap: 4px; width: 104px; font-size: 13px; font-weight: 800; }
.medal .badge-medal { width: 64px; height: 64px; font-size: 32px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); }
.medal.locked .badge-medal { background: var(--card-2); filter: grayscale(1); opacity: .5; }
.name-form { max-width: 460px; margin: 0 auto 20px; display: grid; gap: 6px; font-weight: 800; }
.name-form input { padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--text); font: inherit; }
.name-form .hint { font-weight: 600; font-size: 14px; color: var(--muted); }
.center { text-align: center; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; margin-top: 20px; }

/* ---------- text pages ---------- */
.page { max-width: 780px; margin: 0 auto; }
.page h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 900; margin: 10px 0 12px; }
.page h2 { font-size: 24px; font-weight: 900; margin: 30px 0 12px; }
.page .lead { font-size: 19px; color: var(--muted); }
.parent-lessons { display: grid; gap: 12px; }
.parent-lesson { padding: 18px 20px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; border-left: 6px solid var(--c); }
.parent-lesson .emoji { font-size: 32px; grid-row: span 3; }
.parent-lesson h3 { font-size: 19px; font-weight: 900; }
.parent-lesson ul { margin: 0; padding-left: 20px; color: var(--muted); }
.parent-lesson .q { margin: 0; font-size: 15px; }
.tips { padding-left: 22px; display: grid; gap: 6px; }
.privacy-block { padding: 18px 20px; margin-bottom: 12px; }
.privacy-block h2 { margin: 0 0 6px; font-size: 19px; }
.privacy-block p { margin: 0; color: var(--muted); }

/* ---------- footer ---------- */
#site-footer { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 16px 30px; color: var(--muted); font-size: 14px; display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center; }
#site-footer a { color: var(--muted); font-weight: 700; }


@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding-top: 4px; }
  .bit { order: -1; flex-direction: row-reverse; align-items: center; }
  .bit-robot { width: 84px; }
  .bubble::after { display: none; }
  .bar { grid-template-columns: 90px 1fr 40px; font-size: 14px; }
  .lesson-head .icon { width: 60px; height: 60px; font-size: 32px; border-radius: 18px; }
  .activity { padding: 18px; }
  .sort-card .text { font-size: 19px; }
  .scenario { font-size: 17px; }
  .brand small { display: none; }
  #site-header { padding: 12px 16px; gap: 8px; }
  .nav-link { font-size: 14px; padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; }
  #site-header, #site-footer, .no-print, .skip { display: none !important; }
  .diploma { box-shadow: none; margin: 0 auto; }
}
