/* babyweb — one stylesheet for the whole site. No external fonts or network. */
:root {
  --ink: #22303f;
  --muted: #5d6f83;
  --paper: #fffdf6;
  --line: #e3e9f1;
  --c1: #ff8a3d;
  --c2: #2fbfa0;
  --c3: #7a6cff;
  --c4: #ff5d8f;
  --c5: #ffc53d;
  --c6: #4fa3ff;
  --r: 18px;
  --bar: 4.5rem;
  --shadow: 0 5px 0 rgba(34, 48, 63, .09), 0 14px 26px -14px rgba(34, 48, 63, .45);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 18px/1.55 "Schoolbell", "Fredoka", "Comic Sans MS", "Chalkboard SE", cursive, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
/* the play-mat: the welcome art, fixed behind every page so nothing shifts under the content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("/assets/learning-world.webp") center / cover no-repeat;
}
body.home::before { display: none; }
a { color: #1665c0; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: .1em 0 .15em; }
h2 { font-size: 1.15rem; margin: 1.6em 0 .3em; }
p { margin: .5em 0; }
.wrap { max-width: 62rem; margin: 0 auto; padding: clamp(1rem, 3.5vw, 2rem) clamp(1rem, 4vw, 2rem) 1rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 34rem; }
.tip { color: var(--muted); font-size: .9rem; margin-top: 1rem; }

/* the bar: translucent over the page, blurred, so the wash stays visible behind it */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem clamp(1rem, 4vw, 2rem);
  background: rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 2px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.logo::before { content: "🎈"; font-size: 1.35rem; }
.bar .lang { margin-left: auto; font: inherit; padding: .3rem .6rem; border-radius: 1rem; }
.bar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 .8rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.bar nav a:hover, .bar nav a:focus-visible, .bar nav a[aria-current] { background: rgba(122, 108, 255, .13); }
.nav-menu { position: relative; }
.nav-menu summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 .8rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: " ▾"; margin-left: .25rem; }
.nav-menu summary:hover, .nav-menu summary:focus-visible, .nav-menu summary[aria-current] { background: rgba(122, 108, 255, .13); }
.nav-menu div {
  position: absolute;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr;
  min-width: 100%;
  white-space: nowrap;
  gap: .3rem;
  padding: .45rem;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.nav-menu div a {
  display: grid;
  place-items: center start;
  min-width: 2.6rem;
  min-height: 2.5rem;
  padding: 0 .5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
}
.nav-menu div a:hover, .nav-menu div a:focus-visible { background: rgba(122, 108, 255, .13); }
.nav-menu div a[aria-current] { color: #fff; background: var(--c3); }
.nav-menu:not([open]) div { display: none; }
.mute {
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-left: .25rem;
  font-size: 1.1rem;
  line-height: 1;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.mute[aria-pressed="true"] { color: var(--muted); background: #f3f5f9; }

/* the roster of games on the front page */
.games {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.05rem 1.15rem;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--line);
  border-left: 9px solid var(--c, var(--c3));
  border-radius: var(--r);
  box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-3px); }
.tile .icon { font-size: 2.1rem; line-height: 1.1; }
.tile b { font-size: 1.12rem; }
.tile span { color: var(--muted); font-size: .93rem; }
.tile .age { margin-top: .5rem; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); opacity: .72; }
.a1 { --c: var(--c1); } .a2 { --c: var(--c2); } .a3 { --c: var(--c3); }
.a4 { --c: var(--c4); } .a5 { --c: var(--c5); } .a6 { --c: var(--c6); }

/* controls: thumbs and keyboards, never a hover-only target */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  padding: .55rem 1.3rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--c, var(--c3));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(34, 48, 63, .22);
  cursor: pointer;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(34, 48, 63, .22); }
.btn.ghost { color: var(--ink); background: #fff; border: 2px solid var(--line); box-shadow: none; }
.btn.is-wrong { background: #e9edf3; color: var(--muted); box-shadow: none; }

.hud { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: .9rem; font-weight: 700; color: var(--muted); }
.hud b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stage {
  position: relative;
  margin-top: .9rem;
  padding: clamp(.75rem, 2.5vw, 1.25rem);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.board { display: grid; gap: .5rem; touch-action: manipulation; }

/* memory */
.board.memory { grid-template-columns: 1fr;
  min-width: 100%;
  white-space: nowrap; max-width: 30rem; margin: 0 auto; }
.flip {
  aspect-ratio: 1;
  display: grid;
  place-items: center start;
  font-size: clamp(1.3rem, 5.5vw, 2.2rem);
  background: var(--c3);
  color: #fff;
  border: 2px solid #6a5cf0;
  border-radius: 14px;
  cursor: pointer;
}
.flip.is-open { background: #fff; color: var(--ink); }
.flip.is-matched { background: #d9f7ee; border-color: var(--c2); }

/* whack-a-mole */
.board.whack { grid-template-columns: repeat(3, 1fr); gap: .7rem; max-width: 28rem; margin: 0 auto; }
.hole {
  aspect-ratio: 1;
  display: grid;
  place-items: center start;
  font-size: clamp(1.8rem, 9vw, 2.8rem);
  background: #f1f6fc;
  border: 3px dashed var(--line);
  border-radius: 50%;
  cursor: default;
}
.hole .mole { visibility: hidden; }
.hole.is-up { border-style: solid; border-color: #ffd9a8; background: #fff5e6; cursor: pointer; }
.hole.is-up .mole { visibility: visible; animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.4); } }

/* bubbles */
.board.bubbles { grid-template-columns: none; }
.field {
  position: relative;
  height: min(56vh, 24rem);
  overflow: hidden;
  background: linear-gradient(#eaf7ff, #f8fcff);
  border-radius: 14px;
}
.bubble {
  position: absolute;
  width: var(--s);
  height: var(--s);
  padding: 0;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .85), transparent 58%),
    var(--c, var(--c6));
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 -6px 12px rgba(34, 48, 63, .16);
  cursor: pointer;
  animation: bob 2.6s ease-in-out infinite alternate;
}
@keyframes bob { to { transform: translateY(-10px); } }
.bubble.is-pop { transform: scale(1.7); opacity: 0; transition: transform .16s ease, opacity .16s ease; animation: none; }

/* snake */
.board.snake {
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 2px;
  max-width: 30rem;
  margin: 0 auto;
  padding: 3px;
  background: #dde8f1;
  border-radius: 12px;
}
.cell { aspect-ratio: 1; background: #fff; border-radius: 4px; }
.cell.is-snake { background: var(--c2); }
.cell.is-head { background: #1c9e83; border-radius: 40%; }
.cell.is-food { background: var(--c1); border-radius: 50%; }
.gameover { text-align: center; padding: 1rem 0; }
.gameover p { font-weight: 800; font-size: 1.3rem; }

/* tic-tac-toe */
.board.ttt { grid-template-columns: repeat(3, 1fr); gap: .45rem; max-width: 21rem; margin: 0 auto; }
.cell-btn {
  aspect-ratio: 1;
  display: grid;
  place-items: center start;
  font: inherit;
  font-size: clamp(2rem, 11vw, 3.2rem);
  font-weight: 800;
  background: #f6f9fd;
  border: 3px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.cell-btn[data-mark="X"] { color: var(--c3); }
.cell-btn[data-mark="O"] { color: var(--c4); }
.cell-btn:disabled { cursor: default; }

/* counting */
.count-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.3;
  min-height: 2.5em;
  align-content: center;
}
.answers { display: grid; grid-template-columns: 1fr;
  min-width: 100%;
  white-space: nowrap; gap: .55rem; max-width: 26rem; margin: 1.1rem auto 0; }
.answers .btn { font-size: 1.35rem; }

/* round-over / congratulations panel */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center start;
  padding: 1rem;
  text-align: center;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: var(--r);
}
.overlay[hidden] { display: none; }
.overlay p { font-weight: 800; font-size: 1.35rem; margin: 0 0 .6rem; }

.foot { padding: 2.5rem 1rem 3rem; text-align: center; color: var(--muted); font-size: .85rem; }
.foot a { color: var(--muted); }

/* the rooms on the front page: the same tiles as the games, wider, because there are four of them
   across the whole site and they are what a grown-up is looking for */
.rooms {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}

/* school: the row of ages, then one year at a time */
.head { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1.5rem; margin: 1.2rem 0 .5rem; }
.ages { flex: 1; display: flex; align-items: center; gap: .8rem; font-weight: 800; }
.ages input { flex: 1; max-width: 24rem; accent-color: var(--c3); }
.ages output { min-width: 1.5rem; font-size: 1.3rem; }
.areas, .piano-lesson { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; }
.areas a, .piano-lesson a { display: grid; justify-items: center; gap: .3rem; width: 8.5rem; padding: .6rem; font-weight: 800; text-align: center; color: var(--ink); text-decoration: none; background: rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 0; border-radius: var(--r); }
.areas a.is-here { box-shadow: 0 0 0 3px var(--c3); }
.areas img, .piano-lesson img { height: 5.5rem; width: auto; max-width: 100%; object-fit: contain; }
.year-head h2 { margin: 1.2rem 0 0; font-size: clamp(1.3rem, 3.4vw, 1.7rem); }
.grades { color: var(--muted); font-size: .9rem; margin: 0; }
.aim { font-weight: 700; }
.lesson { padding: .8rem 1rem 1rem; background: #fff; border: 2px solid var(--line); border-left: 9px solid var(--c2); border-radius: var(--r); }
.lesson ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.lesson li { margin-bottom: .3rem; }
.pathway { margin-top: 1.5rem; }
.pathway .intro { color: var(--muted); margin: .3rem 0 0; }
.pics { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .8rem; }
.pics img { height: 9rem; width: auto; }
.pathway .lesson { margin-top: .8rem; }
.pathway .lesson h4 { margin: 0; font-size: 1.04rem; }
.pathway .lesson p { margin: .5rem 0; }
.pathway .check { color: #216451; }
.pathway .ready { color: var(--muted); }
.talk { margin-left: .5rem; padding: 0 .4rem; font-size: 1rem; line-height: 1.6; background: #f3f5f9; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.talk.on { background: #ffe9a8; }
.lesson li { list-style: none; margin-left: -1.2rem; }
.lesson li input { margin-right: .5rem; width: 1.2rem; height: 1.2rem; vertical-align: middle; }
.lesson li.is-done span { text-decoration: line-through; color: var(--muted); }
.lesson .progress { font-weight: 700; color: var(--muted); }
.lesson.done { border-left-color: #2e9e6b; background: #f1fbf5; }
.lesson.done .progress { color: #216451; }
ul.resources { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .55rem; }
ul.resources li { padding: .7rem 1rem; background: #fff; border: 2px solid var(--line); border-radius: var(--r); }
ul.resources .what { display: block; color: var(--muted); font-size: .9rem; }

/* radio: one station playing at a time, on a screen above the list */
.player { display: grid; gap: .8rem; justify-items: center; margin-top: 1rem; }
.player[hidden] { display: none; }
.now { color: var(--muted); font-size: .95rem; font-weight: 700; margin: 0; text-align: center; }
.screen { width: 100%; max-width: 46rem; aspect-ratio: 16 / 9; overflow: hidden; background: #12202e; border-radius: var(--r); }
.screen iframe { width: 100%; height: 100%; border: 0; }
.stations { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.station { display: grid; gap: .35rem; align-content: start; padding: 1rem 1.1rem; background: #fff; border: 2px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.station .what { color: var(--muted); font-size: .9rem; }
.station-play { justify-self: start; }
.station-play[aria-pressed="true"] { background: var(--c2); }
.station-link { font-size: .9rem; }
.station-group { margin: 1.8rem 0 0; }
.station-group + .lede { margin-top: .2rem; }

/* the channel list: the same tile as a game, but it leaves the site */
.channels { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.channels li { display: flex; }
.channels .tile { flex: 1; }
.channels .tile .age { color: var(--muted); opacity: 1; }

/* five rooms in the bar is too many for a phone held sideways: let it wrap rather than spill */
.bar { flex-wrap: wrap; }
@media (max-width: 30rem) {
  .bar nav a { padding: 0 .55rem; font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.brand { position: relative; display: flex; line-height: 1.1; }
.ver { position: absolute; top: 100%; left: 0; z-index: 10; white-space: nowrap; font-size: .7rem; padding: .15rem .45rem; border-radius: .4rem; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .15s; }
.brand:hover .ver, .brand:focus-within .ver { opacity: 1; }
/* kid font, bundled so the site still loads nothing from the network */
@font-face { font-family: "Fredoka"; src: url("/assets/fredoka.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }
/* sign-in gate: everything but the title waits until a name is set (site.js adds .signed-in) */
.desk { position: fixed; inset: 0; z-index: -1; } /* desk art is the page background, whole picture incl. the wall plank */
.desk-bg { width: 100%; height: 100%; object-fit: fill; display: block; }
.desk a { position: absolute; bottom: 30%; transition: transform .2s; }
.desk a:hover, .desk a:focus { transform: scale(1.08); }
.desk a img { width: 100%; display: block; }
body:not(.signed-in) :is(.bar .lang, .bar .mute, main, .foot) { display: none; }
.gate { max-width: 22rem; margin: 12vh auto; padding: 1.5rem; text-align: center; border-radius: 1.5rem; background: rgba(255, 255, 255, .55); backdrop-filter: blur(12px); }
.gate input, .gate button { font: inherit; display: block; width: 100%; margin-top: .6rem; padding: .6rem 1rem; border-radius: 999px; border: 0; }
.gate button { background: #7a6cff; color: #fff; cursor: pointer; }
@font-face { font-family: "Comic Neue"; src: url("/assets/comicneue.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url("/assets/baloo2.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("/assets/patrickhand.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Andika"; src: url("/assets/andika.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Schoolbell"; src: url("/assets/schoolbell.ttf") format("truetype"); font-display: swap; }
.pick { background: rgba(255,255,255,.7); border-radius: 16px; padding: 12px 20px; margin-top: 16px; }
.pick-row { display: flex; gap: 12px; flex-wrap: wrap; }
.pick figure { margin: 0; text-align: center; font-weight: 700; }
.pick img { width: 110px; height: 110px; border-radius: 16px; }
.pick p { font-size: 22px; margin: 6px 0; }
.signout { font: inherit; border: 0; border-radius: 999px; padding: .3rem .8rem; background: #7a6cff; color: #fff; cursor: pointer; }
.home-logo{display:block;max-width:min(320px,80%);height:auto;margin:0 0 1rem}
.brand .logo::before{content:none}
.bar-logo{display:block;height:2.6rem;width:auto}
/* logo: owl cropped out of the picture, wordmark is real text so its letters are as tall as the owl (2.6rem) */
.bar-logo { width: 2.47rem; object-fit: cover; object-position: left; }
.bar-word { font: 700 3.4rem/.8 "Fredoka", sans-serif; color: #18a8f0; }
.bar-word b { color: #004080; }
.bar .lang { color: #fff; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 3px #000; border: 2px solid #fff; background-size: cover; background-position: center; }
.bar .lang option { color: #000; text-shadow: none; background: #fff; }
.bar .lang[data-lang="fr"] { background-image: linear-gradient(90deg, #0055a4 33.3%, #fff 33.3% 66.6%, #ef4135 66.6%); }
.bar .lang[data-lang="ro"] { background-image: linear-gradient(90deg, #002b7f 33.3%, #fcd116 33.3% 66.6%, #ce1126 66.6%); }
.bar .lang[data-lang="en"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30' preserveAspectRatio='none'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0 0L60 30M60 0L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0L60 30M60 0L0 30' stroke='%23c8102e' stroke-width='2'/%3E%3Cpath d='M30 0V30M0 15H60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0V30M0 15H60' stroke='%23c8102e' stroke-width='6'/%3E%3C/svg%3E"); }
input:not([type=range],[type=checkbox],[type=radio]), textarea, select { background: rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 0; border-radius: .5rem; }
input:not([type=range],[type=checkbox],[type=radio]), textarea, select { color: #fff; text-shadow: 1px 1px 0 #000; }
:is(select, textarea) option { color: #000; text-shadow: none; }

/* slides: a page of [data-slide] sections is a deck. Each is a screenful under the bar, snaps into place on a
   swipe, and its content settles in as it arrives (the slide itself never moves, only what is inside it). */
html:has([data-slide]) { scroll-snap-type: y proximity; scroll-behavior: smooth; scroll-padding-top: var(--bar); }
.wrap:has([data-slide]) { padding-block: 0; }
[data-slide] {
  display: grid;
  align-content: center;
  min-height: calc(100vh - var(--bar));
  min-height: calc(100svh - var(--bar));
  padding-block: clamp(1rem, 4vh, 2.5rem);
  scroll-snap-align: start;
  scroll-margin-top: var(--bar);
}
.areas[data-slide] { display: flex; justify-content: center; align-items: center; align-content: center; margin: 0; }
[data-slide].is-arriving > * { animation: slide-down .55s cubic-bezier(.22, .61, .36, 1) both; }
[data-slide].is-leaving > * { animation: slide-up .45s cubic-bezier(.4, 0, .75, .25) both; }
@keyframes slide-down { from { transform: translateY(-3rem); } }
@keyframes slide-up { to { transform: translateY(-3rem); } }
