:root {
  --navy: #15264D;
  --ink: #1d2b4f;
  --sky: #EAF4FF;
  --paper: #ffffff;
  --yellow: #FFB800;
  --orange: #FF7A1A;
  --pink: #F25CC1;
  --green: #3FC93F;
  --blue: #1E5BFF;
  --cyan: #18B6E8;
  --line: #d7e3f5;
  --maths: var(--blue);
  --english: var(--pink);
  --science: var(--green);
  --radius-big: 28px;
  --radius-small: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9efff;
    --sky: #0f1a36;
    --paper: #172447;
    --line: #2a3b66;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sky);
}
h1, h2, h3 { font-family: "Baloo 2", "Nunito", system-ui, sans-serif; line-height: 1.1; margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* The rainbow strip from the slides: the brand signature */
.stripe { display: flex; height: 12px; }
.stripe i { flex: 1; }
.stripe i:nth-child(1) { background: var(--orange); }
.stripe i:nth-child(2) { background: var(--cyan); }
.stripe i:nth-child(3) { background: var(--pink); }
.stripe i:nth-child(4) { background: var(--green); }
.stripe i:nth-child(5) { background: var(--yellow); }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1160px; margin: 0 auto; padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 64px; height: 64px; object-fit: contain; }
.brand span { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: 26px; color: var(--navy); }
@media (prefers-color-scheme: dark) { .brand span { color: #fff; } }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.top nav a { text-decoration: none; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.top nav a:hover { background: var(--paper); }

/* Hero: big friendly headline + the two Nexora characters */
.hero {
  max-width: 1160px; margin: 8px auto 0; padding: 32px 24px 48px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center;
}
.hero h1 {
  font-size: clamp(44px, 7vw, 84px); font-weight: 800; color: var(--navy); letter-spacing: -0.01em;
}
@media (prefers-color-scheme: dark) { .hero h1 { color: #fff; } }
.hero p { font-size: 20px; max-width: 34ch; margin: 18px 0 26px; }
.hero-subjects { display: flex; gap: 12px; flex-wrap: wrap; }
.subj {
  font: 800 22px "Baloo 2", sans-serif; color: #fff; border: 0; cursor: pointer;
  padding: 12px 26px; border-radius: 18px; box-shadow: 0 5px 0 rgba(21, 38, 77, .35);
  transition: transform .12s, box-shadow .12s;
}
.subj:hover { transform: translateY(-2px); }
.subj:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(21, 38, 77, .35); }
.subj.maths { background: var(--maths); }
.subj.english { background: var(--english); }
.subj.science { background: var(--science); }
.hero-kids { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 10px; min-height: 300px; }
.kid { height: 280px; width: auto; }
.kid.girl { height: 270px; }
.bubble {
  position: absolute; top: 0; right: 4%; background: var(--yellow); color: var(--navy);
  font: 800 20px "Baloo 2", sans-serif; padding: 10px 18px; border-radius: 22px 22px 22px 4px;
}

/* Lessons */
.lessons { max-width: 1160px; margin: 0 auto; padding: 24px; }
.lessons-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lessons h2, .parents h2, .foot h2 { font-size: 40px; font-weight: 800; color: var(--navy); }
@media (prefers-color-scheme: dark) { .lessons h2, .parents h2 { color: #fff; } }
.count { margin: 0; font-weight: 700; opacity: .75; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 18px 0 24px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: 700 15px "Nunito", sans-serif; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.on { background: var(--yellow); border-color: var(--yellow); color: var(--navy); } }
.search { margin-left: auto; }
.search input {
  font: 600 16px "Nunito", sans-serif; color: var(--ink); background: var(--paper);
  border: 2px solid var(--line); border-radius: 999px; padding: 9px 16px; width: 240px; max-width: 100%;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--paper); border-radius: var(--radius-big); overflow: hidden;
  border: 3px solid var(--subject); display: flex; flex-direction: column;
}
.card[data-subject="Maths"] { --subject: var(--maths); }
.card[data-subject="English"] { --subject: var(--english); }
.card[data-subject="Science"] { --subject: var(--science); }
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--subject); display: grid; place-items: center; border: 0; padding: 0; cursor: pointer; width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ph { font: 800 26px "Baloo 2", sans-serif; color: #fff; padding: 0 16px; text-align: center; }
.thumb .play {
  position: absolute; width: 58px; height: 58px; border-radius: 50%; background: var(--yellow);
  display: grid; place-items: center; box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.thumb .play::after { content: ""; border-left: 18px solid var(--navy); border-top: 11px solid transparent; border-bottom: 11px solid transparent; margin-left: 5px; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tags { display: flex; gap: 6px; }
.tag { font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--subject); color: #fff; }
.tag.year { background: var(--sky); color: var(--ink); }
.card h3 { font-size: 23px; font-weight: 800; }
.card p { margin: 0; font-size: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.btn {
  font: 800 15px "Nunito", sans-serif; text-decoration: none; border-radius: var(--radius-small);
  padding: 8px 14px; border: 2px solid var(--subject); color: var(--ink); background: transparent; cursor: pointer;
}
.btn.primary { background: var(--subject); color: #fff; }
.empty { font-weight: 700; padding: 24px; background: var(--paper); border-radius: var(--radius-small); }

/* Lesson content in the pop-up */
.lesson-content h4 { font: 800 22px "Baloo 2", sans-serif; margin: 14px 0 6px; }
.parts { margin: 0; padding: 0; list-style: none; counter-reset: part; display: flex; flex-direction: column; gap: 8px; }
.parts li { counter-increment: part; }
.parts details { border: 2px solid var(--line); border-radius: var(--radius-small); background: var(--sky); }
.parts details[open] { border-color: var(--subject); }
.parts summary { cursor: pointer; font-weight: 800; padding: 10px 14px; list-style: none; display: flex; gap: 10px; align-items: center; }
.parts summary::-webkit-details-marker { display: none; }
.parts summary::before {
  content: counter(part); flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: var(--subject); color: #fff; display: grid; place-items: center; font-size: 14px;
}
.parts summary::after { content: "+"; margin-left: auto; font-size: 20px; }
.parts details[open] summary::after { content: "−"; }
.parts p { margin: 0; padding: 0 14px 12px 52px; line-height: 1.6; }

/* Lesson page */
.lesson-page { max-width: 1000px; margin: 0 auto; padding: 16px 24px 40px; }
.lesson-page[data-subject="Maths"] { --subject: var(--maths); }
.lesson-page[data-subject="English"] { --subject: var(--english); }
.lesson-page[data-subject="Science"] { --subject: var(--science); }
.loading { font-weight: 700; padding: 40px 0; }
.back { font-weight: 800; text-decoration: none; display: inline-block; margin-bottom: 14px; }
.lp-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.lp-head h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; color: var(--navy); }
@media (prefers-color-scheme: dark) { .lp-head h1 { color: #fff; } }
.lp-desc { font-size: 19px; margin: 0; }
.lp-video { aspect-ratio: 16 / 9; border-radius: var(--radius-big); overflow: hidden; margin-bottom: 28px; background: #000; }
.lp-video iframe { width: 100%; height: 100%; border: 0; }
.lp-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 24px; }
.lp-step { background: var(--paper); border-radius: var(--radius-big); overflow: hidden; border: 3px solid var(--subject); }
.lp-slide { background: var(--sky); aspect-ratio: 16 / 9; display: grid; place-items: center; }
.lp-slide canvas, .lp-slide img { width: 100%; height: auto; display: block; }
.lp-slide canvas:not(.ready) { aspect-ratio: 16 / 9; background: linear-gradient(90deg, var(--sky), var(--paper), var(--sky)); }
.lp-text { padding: 18px 22px 22px; }
.lp-text h2 { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.lp-text .num { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--subject); color: #fff; display: grid; place-items: center; font-size: 18px; }
.lp-text p { font-size: 18px; line-height: 1.65; margin: 10px 0 12px; max-width: 70ch; }
.listen { font: 800 15px "Nunito", sans-serif; border: 2px solid var(--subject); background: transparent; color: var(--ink); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.listen.on { background: var(--subject); color: #fff; }
.lp-empty { background: var(--paper); border-radius: var(--radius-big); overflow: hidden; }
.lp-empty img { width: 100%; display: block; }
.lp-empty p { padding: 18px 22px; margin: 0; font-weight: 700; }
.lp-end { margin-top: 28px; background: var(--yellow); color: var(--navy); border-radius: var(--radius-big); padding: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.lp-end h2 { font-size: 32px; }
.lp-end p { margin: 0; font-weight: 700; }
.lp-end .btn.primary { --subject: var(--navy); }
@media (max-width: 820px) { .lesson-page { padding: 12px 16px 32px; } .lp-text p { font-size: 17px; } }

.voice-pick { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.voice-pick select { font: 700 15px "Nunito", sans-serif; color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: 999px; padding: 6px 12px; max-width: 100%; }

/* News */
.news { max-width: 1160px; margin: 40px auto 0; padding: 24px; }
.news h2 { font-size: 40px; font-weight: 800; color: var(--navy); }
@media (prefers-color-scheme: dark) { .news h2 { color: #fff; } }
.news-intro { margin: 6px 0 18px; }
.news-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.news-col { background: var(--paper); border-radius: var(--radius-big); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.news-h { font-size: 24px; padding-left: 12px; border-left: 6px solid; }
.news-h.tg { border-color: #229ED9; } .news-h.fb { border-color: #1877F2; }
.tg-feed { display: flex; flex-direction: column; gap: 12px; max-height: 760px; overflow-y: auto; }
.fb-box { min-height: 160px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.fb-box p { margin: 0; }
.btn.fbbtn { --subject: #1877F2; }
.btn.more { align-self: flex-start; }
.btn.more.tg { --subject: #229ED9; border-color: #229ED9; }
.btn.more.fb { --subject: #1877F2; border-color: #1877F2; }
@media (max-width: 820px) { .news-cols { grid-template-columns: 1fr; } .news { padding: 16px; } }

/* Parents */
.parents { max-width: 1160px; margin: 40px auto 0; padding: 24px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 18px; }
.how div { background: var(--paper); border-radius: var(--radius-big); padding: 22px; }
.how b {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--yellow); color: var(--navy); font: 800 22px "Baloo 2", sans-serif;
}
.how h3 { font-size: 24px; margin: 10px 0 4px; }
.how p { margin: 0; }

/* Footer */
.foot { background: var(--navy); color: #fff; padding: 40px 24px 28px; margin-top: 56px; text-align: center; }
.foot h2 { color: #fff; }
.social { list-style: none; padding: 0; margin: 20px auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 760px; }
.social a { display: inline-block; text-decoration: none; font-weight: 800; padding: 10px 18px; border-radius: 999px; color: #fff; }
.social .fb { background: #1877F2; } .social .ig { background: #D62976; } .social .tt { background: #000; border: 2px solid #fff; }
.social .yt { background: #FF0000; } .social .wa { background: #25D366; color: #08331a; } .social .tg { background: #229ED9; }
.small { font-size: 14px; opacity: .8; margin: 0; }

dialog { border: 0; padding: 0; border-radius: var(--radius-big); width: min(860px, 94vw); max-height: 92vh; background: var(--paper); color: var(--ink); overflow-y: auto; }
dialog[data-subject="Maths"] { --subject: var(--maths); }
dialog[data-subject="English"] { --subject: var(--english); }
dialog[data-subject="Science"] { --subject: var(--science); }
.frame { position: relative; background: var(--subject); display: grid; place-items: center; }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlg-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.dlg-body h3 { font-size: 30px; }
.dlg-body p { margin: 0; }
.note { font-weight: 700; opacity: .7; align-self: center; }
.soon { position: absolute; bottom: 10px; left: 10px; background: var(--yellow); color: var(--navy); font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.soon.big { font-size: 16px; padding: 6px 14px; }
.title-btn { all: unset; cursor: pointer; }
.title-btn:hover { text-decoration: underline; }
.title-btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
dialog::backdrop { background: rgba(10, 18, 40, .75); }
.frame { aspect-ratio: 16 / 9; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--yellow); color: var(--navy); font-size: 18px; font-weight: 800; cursor: pointer; }

@media (max-width: 820px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .brand img { width: 46px; height: 46px; }
  .brand span { font-size: 22px; }
  .top nav a { padding: 6px 10px; font-size: 15px; }
  .hero { grid-template-columns: 1fr; text-align: left; padding: 16px 16px 32px; }
  .hero-kids { min-height: 170px; }
  .kid { height: 150px; } .kid.girl { height: 144px; }
  .bubble { font-size: 16px; right: 0; }
  .lessons, .parents { padding: 16px; }
  .how { grid-template-columns: 1fr; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .subj { transition: none; }
}
