@font-face { font-family: "Ethi"; src: url("../assets/fonts/NotoSansEthiopic-Bold.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Ethi"; src: url("../assets/fonts/NotoSansEthiopic-Black.ttf") format("truetype"); font-weight: 800 900; font-display: swap; }

:root {
  --red: #f05a28; --orange: #f59600; --yellow: #ffcf33; --green: #28a546; --teal: #009ba5;
  --blue: #1e6ef0; --purple: #963cdc; --pink: #e63278; --ink: #24304a; --paper: #fffaf0;
  --rainbow: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple));
  --r: 22px; --shadow: 0 6px 0 rgba(36, 48, 74, .14), 0 10px 24px rgba(36, 48, 74, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font-family: "Ethi", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif; font-weight: 700;
  background-image: radial-gradient(circle at 10% 10%, #ffe9b0 0 120px, transparent 121px),
                    radial-gradient(circle at 92% 30%, #d6ecff 0 160px, transparent 161px),
                    radial-gradient(circle at 20% 90%, #ffd9e8 0 140px, transparent 141px);
  background-attachment: fixed; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 18px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 6px solid transparent;
  border-image: var(--rainbow) 1; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-size: 1.3rem; font-weight: 900; }
.brand img { width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--yellow); }
.brand small { display: block; font-size: .8rem; color: var(--purple); }
.nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 14px; border-radius: 999px; text-align: center; line-height: 1.1; }
.nav a small { display: block; font-size: .7rem; color: #7a849a; }
.nav a:hover, .nav a.on { background: #fff1c2; }
.stars { background: var(--yellow); padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.menu-btn { display: none; margin-left: auto; border: 0; background: var(--yellow); border-radius: 12px; font-size: 1.4rem; padding: 6px 12px; }
@media (max-width: 760px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px; box-shadow: var(--shadow); }
  .nav-open .nav { display: flex; }
}

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 16px 40px; }
.foot { text-align: center; color: #7a849a; font-size: .85rem; padding: 18px; }

h1, h2 { font-weight: 900; margin: .2em 0 .4em; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); }
.sub { color: #6a7590; margin-top: -6px; }
.page-head { text-align: center; margin-bottom: 18px; }
.page-head .am { color: var(--purple); }

/* ---------- home ---------- */
.hero { position: relative; border-radius: 32px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 26px; background: #fff; }
.hero img.banner { width: 100%; display: block; aspect-ratio: 16 / 5; object-fit: cover; }
.hero .hero-copy { padding: 18px 24px 24px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero .hero-copy h1 { margin: 0; }
.hero .hero-copy p { margin: 4px 0 0; color: #6a7590; }
.hero .cta { margin-left: auto; }
.btn { display: inline-block; border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 900; font-size: 1.05rem;
  background: var(--green); color: #fff; text-decoration: none; box-shadow: 0 5px 0 #1b7a33; transition: transform .1s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #1b7a33; }
.btn.blue { background: var(--blue); box-shadow: 0 5px 0 #1450b5; }
.btn.pink { background: var(--pink); box-shadow: 0 5px 0 #a81e55; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 5px 0 #d8dbe4; }

.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; }
.section-title::after { content: ""; flex: 1; height: 6px; border-radius: 6px; background: var(--rainbow); opacity: .5; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card { display: block; text-decoration: none; color: var(--ink); background: #fff; border-radius: var(--r); padding: 18px;
  box-shadow: var(--shadow); transition: transform .15s; position: relative; overflow: hidden; border-top: 8px solid var(--c, var(--blue)); }
.card:hover { transform: translateY(-4px) rotate(-.5deg); }
.card .icon { font-size: 2.6rem; line-height: 1; height: 64px; display: flex; align-items: center; }
.card .icon.fidel { font-size: 3rem; color: var(--c); font-weight: 900; }
.card .icon img { height: 64px; border-radius: 14px; }
.card b { display: block; font-size: 1.15rem; margin-top: 8px; }
.card span { color: #7a849a; font-size: .9rem; }

/* ---------- fidel chart ---------- */
.chart-wrap { overflow-x: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; }
table.chart { border-collapse: separate; border-spacing: 6px; margin: 0 auto; }
table.chart th { color: #9aa3b8; font-size: .8rem; }
.fbtn { width: 64px; height: 64px; border-radius: 16px; border: 0; font-size: 2rem; font-weight: 900; color: #fff;
  background: var(--c); box-shadow: 0 4px 0 rgba(0, 0, 0, .18); position: relative; transition: transform .1s; }
.fbtn:hover { transform: scale(1.08); }
.fbtn.playing { animation: boing .5s; }
.fbtn small { position: absolute; bottom: 2px; left: 0; right: 0; font-size: .6rem; opacity: .85; font-family: system-ui; }
.fbtn.no-audio::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .6); }
.legend { text-align: center; color: #7a849a; font-size: .85rem; margin-top: 10px; }
@keyframes boing { 0% { transform: scale(1); } 30% { transform: scale(1.3) rotate(-6deg); } 60% { transform: scale(.92); } 100% { transform: scale(1); } }

/* ---------- learn ---------- */
.stage { background: #fff; border-radius: 32px; box-shadow: var(--shadow); padding: 24px; text-align: center; position: relative; }
.big-letter { font-size: clamp(7rem, 22vw, 13rem); font-weight: 900; line-height: 1; color: var(--c); cursor: pointer;
  text-shadow: 0 8px 0 rgba(0, 0, 0, .08); display: inline-block; user-select: none; }
.big-letter.playing { animation: boing .6s; }
.translit { font-family: system-ui; font-size: 1.6rem; color: #7a849a; }
.pic-word { display: inline-flex; align-items: center; gap: 16px; background: #fff7dc; border-radius: 22px; padding: 10px 20px 10px 10px; margin-top: 14px; cursor: pointer; }
.pic-word img { width: 110px; height: 110px; object-fit: cover; border-radius: 16px; }
.pic-word b { font-size: 2.2rem; display: block; }
.pic-word span { color: #7a849a; font-family: system-ui; }
.stage-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 10px; flex-wrap: wrap; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 14px 0; }
.picker button { border: 0; border-radius: 12px; width: 46px; height: 46px; font-size: 1.4rem; font-weight: 900; background: #eef1f7; color: var(--ink); }
.picker button.on { background: var(--c); color: #fff; }
.family-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 18px 0; }
.family-row .fbtn { width: clamp(70px, 11vw, 110px); height: clamp(70px, 11vw, 110px); font-size: clamp(2.2rem, 5vw, 3.6rem); border-radius: 24px; }
.family-row .fbtn small { font-size: .85rem; bottom: 4px; }
.hero-pic { position: absolute; right: 12px; bottom: 12px; width: 110px; border-radius: 20px; opacity: .95; }
@media (max-width: 700px) { .hero-pic { display: none; } }

/* ---------- games ---------- */
.game { max-width: 760px; margin: 0 auto; }
.score { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; font-size: 1.4rem; min-height: 1.6em; }
.prompt { font-size: 1.2rem; color: #6a7590; margin-bottom: 8px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-top: 18px; }
.choice { border: 0; border-radius: 22px; background: #fff; box-shadow: var(--shadow); padding: 16px 10px; font-size: 2.4rem; font-weight: 900; color: var(--ink); min-height: 92px; transition: transform .1s; }
.choice:hover { transform: translateY(-3px); }
.choice.latin { font-family: system-ui; font-size: 1.8rem; }
.choice.small { font-size: 1.5rem; }
.choice.right { background: #c9f7d3; animation: boing .5s; }
.choice.wrong { background: #ffd3d3; animation: shake .4s; }
.choice img { width: 100%; max-width: 150px; aspect-ratio: 1; object-fit: cover; border-radius: 16px; display: block; margin: 0 auto; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.slots { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.slot { width: 74px; height: 84px; border-radius: 18px; border: 4px dashed #c9cfdc; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 900; color: #fff; }
.slot.filled { border: 0; background: var(--c); box-shadow: 0 4px 0 rgba(0, 0, 0, .15); animation: boing .4s; }
.slot small { font-size: .7rem; }
.pool { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pool .fbtn { width: 74px; height: 84px; font-size: 2.6rem; }
.pool .fbtn.used { visibility: hidden; }
.houses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.house { border: 0; background: none; padding: 0; }
.house .roof { width: 0; height: 0; margin: 0 auto; border-left: 70px solid transparent; border-right: 70px solid transparent; border-bottom: 50px solid var(--c); filter: brightness(.85); }
.house .body { background: var(--c); color: #fff; border-radius: 0 0 18px 18px; width: 140px; margin: 0 auto; padding: 14px 6px; font-size: 1.1rem; }
.house .body b { display: block; font-size: 2.6rem; }
.house.right .body { animation: boing .5s; } .house.wrong { animation: shake .4s; }
.done { text-align: center; padding: 30px; }
.done img { width: 180px; border-radius: 24px; }
.listen-btn { font-size: 3rem; width: 120px; height: 120px; border-radius: 50%; border: 0; background: var(--yellow); box-shadow: var(--shadow); }
.listen-btn:active { transform: scale(.95); }

/* ---------- numbers / words ---------- */
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.num { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; text-align: center; border-top: 8px solid var(--c); }
.num .g { font-size: 3.6rem; font-weight: 900; color: var(--c); line-height: 1.1; }
.num .a { font-family: system-ui; font-size: 1.4rem; color: #7a849a; }
.num .w { font-size: 1.3rem; } .num .t { font-family: system-ui; color: #9aa3b8; font-size: .9rem; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.word { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; text-align: center; padding-bottom: 12px; }
.word img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.word .swatch { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.word b { display: block; font-size: 1.7rem; margin-top: 8px; }
.word span { font-family: system-ui; color: #7a849a; font-size: .95rem; }
.word i { font-style: normal; display: block; color: var(--purple); font-family: system-ui; font-size: .85rem; }
.tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { text-decoration: none; padding: 10px 16px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); color: var(--ink); }
.tabs a.on { background: var(--purple); color: #fff; }

/* ---------- videos ---------- */
.vid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.vid { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 0; padding: 0; text-align: left; }
.vid .thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.vid .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid .thumb::after { content: "▶"; position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(240, 90, 40, .92); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.vid iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.vid p { margin: 0; padding: 12px 14px; }
.vid p small { display: block; color: #7a849a; font-weight: 600; }
.prose { max-width: 760px; margin: 0 auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 26px 30px; font-weight: 500; line-height: 1.6; }
.prose h2 { margin-top: 1em; }

/* ---------- toast / confetti ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 200%); visibility: hidden; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; transition: transform .3s; z-index: 40; font-size: .95rem; }
#toast.show { transform: translate(-50%, 0); visibility: visible; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
