/* ================= 291 Academy ================= */
/* Theme colors: change them here and the whole site updates */
:root {
  --navy: #0B1F3A;
  --navy-2: #12305A;
  --navy-3: #1B3F70;
  --sky: #7EC8E3;
  --sky-dark: #4FA6C6;
  --brown: #C49A6C;
  --brown-dark: #9C7448;
  --ivory: #FFF8E7;
  --ivory-2: #F3E8CF;
  --text: #0B1F3A;
  --muted: #5A6B82;
  --green: #4CAF7A;
  --red: #E26A5A;
  --font-display: "Baloo 2", "Noto Sans Ethiopic", system-ui, sans-serif;
  --font-body: "Nunito", "Noto Sans Ethiopic", system-ui, sans-serif;
  --font-geez: "Noto Sans Ethiopic", "Nyala", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  background: var(--navy);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 12px; }
h2 { font-size: clamp(30px, 4.4vw, 46px); }
p { margin: 0 0 14px; }
.geez { font-family: var(--font-geez); }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.sub { color: inherit; opacity: .75; }

/* ---------- Scroll progress bar ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0; z-index: 60;
  background: linear-gradient(90deg, var(--sky), var(--brown));
}

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 31, 58, .85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(126, 200, 227, .15);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--ivory); text-decoration: none; }
.brand b { color: var(--sky); }
.brand img { height: 48px; width: auto; display: block; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--ivory); text-decoration: none; font-weight: 700; font-size: 15px;
  padding: 7px 13px; border-radius: 999px; transition: background .2s, color .2s;
}
.nav a:hover, .nav a.active { background: rgba(126, 200, 227, .18); color: var(--sky); }
.nav .nav-cta { background: var(--brown); color: var(--navy); box-shadow: 0 3px 0 var(--brown-dark); }
.nav .nav-cta:hover { background: var(--ivory); color: var(--navy); }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 3px; margin: 4px 0; background: var(--ivory); border-radius: 3px; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons (Duolingo-style 3D) ---------- */
.btn {
  display: inline-block; cursor: pointer; border: 0;
  font: 800 17px/1 var(--font-body); text-decoration: none; letter-spacing: .3px;
  padding: 15px 26px; border-radius: 16px;
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent !important; }
.btn-sky { background: var(--sky); color: var(--navy); box-shadow: 0 5px 0 var(--sky-dark); }
.btn-ivory { background: var(--ivory); color: var(--navy); box-shadow: 0 5px 0 var(--ivory-2), 0 5px 0 2px rgba(0,0,0,.08); }
.btn-brown { background: var(--brown); color: var(--navy); box-shadow: 0 5px 0 var(--brown-dark); }

/* ---------- 1. Hero with the logo ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100vh - 64px);
  display: grid; place-items: center;
  padding: 24px 0 70px; text-align: center;
  background: radial-gradient(ellipse at 50% 40%, var(--navy-3), var(--navy) 70%);
}
.hero-in { position: relative; z-index: 2; width: min(1000px, 100% - 24px); }
.greet { color: var(--brown); font-weight: 700; font-size: 20px; margin: 0; }
.logo {
  position: relative; width: min(100%, 900px); margin: 0 auto;
  aspect-ratio: 1774 / 887;
  animation: floaty 6s ease-in-out infinite;
}
.logo > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.eye {
  position: absolute; overflow: hidden; pointer-events: none;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.eye img { position: absolute; max-width: none; will-change: transform; }
.hero-text { font-size: clamp(17px, 2.2vw, 21px); margin: 4px auto 18px; max-width: 640px; }
.hero-text b { color: var(--sky); }
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hint {
  display: inline-block; margin-top: 18px; font-size: 14px; font-weight: 700;
  color: var(--sky); background: rgba(126, 200, 227, .12); padding: 5px 14px; border-radius: 999px;
}
@keyframes floaty { 50% { transform: translateY(-10px); } }

/* twinkling stars */
.stars, .stars::after {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 10% 20%, #fff8 50%, transparent 51%),
    radial-gradient(2px 2px at 30% 70%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 15%, #fff9 50%, transparent 51%),
    radial-gradient(2px 2px at 80% 35%, #fff7 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 92% 80%, #fff8 50%, transparent 51%),
    radial-gradient(2px 2px at 20% 90%, #fff5 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 65% 85%, #fff7 50%, transparent 51%);
}
.stars::after { content: ""; transform: translate(4%, 6%); animation: twinkle 3s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .2; } to { opacity: 1; } }

/* moving clouds behind the logo */
.sky { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.cloud {
  position: absolute; display: block;
  width: 260px; height: 80px; border-radius: 80px;
  background: var(--ivory); opacity: .13;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 110px; height: 110px; left: 40px; top: -55px; }
.cloud::after { width: 140px; height: 140px; right: 30px; top: -75px; }
.c1 { top: 18%; animation-duration: 60s; animation-delay: -10s; }
.c2 { top: 48%; transform: scale(.7); animation-duration: 45s; animation-delay: -30s; opacity: .1; }
.c3 { top: 72%; transform: scale(1.2); animation-duration: 75s; animation-delay: -50s; opacity: .08; }
.c4 { top: 30%; transform: scale(.5); animation-duration: 38s; animation-delay: -5s; opacity: .15; }
.c5 { top: 62%; transform: scale(.9); animation-duration: 55s; animation-delay: -25s; }
@keyframes drift { from { left: -320px; } to { left: 105%; } }

.scroll-down {
  position: absolute; bottom: 20px; left: 50%; z-index: 3; margin-left: -16px;
  width: 32px; height: 52px; border: 3px solid var(--sky); border-radius: 20px;
}
.scroll-down span {
  position: absolute; left: 50%; top: 9px; margin-left: -3px;
  width: 6px; height: 10px; border-radius: 3px; background: var(--sky);
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel { 60% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Section bands ---------- */
.band { position: relative; padding: clamp(60px, 9vw, 110px) 0; }
.band.light { background: var(--ivory); color: var(--text); }
.band.light .tag { background: var(--navy); color: var(--ivory); }
.tag {
  display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
  background: var(--sky); color: var(--navy);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 80px); align-items: center; }
.split.flip > :first-child { order: 2; }

/* About stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat {
  background: #fff; border: 3px solid var(--navy); border-radius: 24px;
  box-shadow: 0 6px 0 var(--navy);
  padding: 22px 18px; text-align: center;
  transition: transform .2s;
}
.stat:hover { transform: translateY(-6px) rotate(-1.5deg); }
.stat:nth-child(2):hover { transform: translateY(-6px) rotate(1.5deg); }
.stat .num { display: block; font: 800 46px/1 var(--font-display); color: var(--sky-dark); }
.stat .num.geez { color: var(--brown-dark); font-size: 38px; font-weight: 800; }
.stat small { font-weight: 700; color: var(--muted); font-size: 15px; }

/* Subject sections: each with its own look */
.subject h2 .geez { color: var(--brown); font-size: .7em; }
.subject.tig {
  background:
    radial-gradient(circle at 10% 20%, rgba(196,154,108,.18), transparent 40%),
    var(--navy-2);
}
.subject.comp {
  background:
    linear-gradient(rgba(126,200,227,.06) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(126,200,227,.06) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--navy);
}
.subject.mth {
  background:
    radial-gradient(circle at 90% 80%, rgba(126,200,227,.15), transparent 40%),
    var(--navy-2);
}
.ticks { list-style: none; padding: 0; margin: 0 0 18px; }
.ticks li { padding-left: 32px; position: relative; margin-bottom: 6px; font-weight: 600; }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 2px;
  width: 22px; height: 22px; border-radius: 50%; font-size: 13px; font-weight: 800;
  display: grid; place-items: center; background: var(--sky); color: var(--navy);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chips span {
  font-weight: 800; font-size: 14px; padding: 5px 13px; border-radius: 999px;
  border: 2px solid rgba(255, 248, 231, .35); transition: background .2s, color .2s, transform .2s;
}
.chips span:hover { background: var(--ivory); color: var(--navy); transform: scale(1.08); }
.play { text-align: center; }
.play-tip { margin-top: 14px; font-weight: 700; color: var(--sky); font-size: 15px; }

/* Fidel board (Tigrinya) */
.fidel-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 420px; margin: 0 auto; }
.fidel-board.big { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); max-width: none; }
.letter {
  aspect-ratio: 1; border: 0; cursor: pointer;
  font: 800 clamp(30px, 5vw, 44px)/1 var(--font-geez);
  color: var(--navy); background: var(--ivory);
  border-radius: 20px; box-shadow: 0 6px 0 var(--brown);
  transition: transform .15s, background .2s;
}
.letter:nth-child(3n+2) { background: var(--sky); box-shadow: 0 6px 0 var(--sky-dark); }
.letter:nth-child(3n) { background: var(--brown); box-shadow: 0 6px 0 var(--brown-dark); }
.letter:hover { transform: translateY(-4px) rotate(-6deg); }
.letter:active { transform: translateY(5px); box-shadow: none; }
.letter.pop { animation: pop .45s; }
@keyframes pop { 40% { transform: scale(1.25) rotate(8deg); } }
.letter small { display: block; font: 700 12px/1 var(--font-body); margin-top: 4px; opacity: .7; }
.orders { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; min-height: 96px; }
.orders .o {
  width: 80px; padding: 10px 0; border-radius: 18px; background: var(--ivory); color: var(--navy);
  font: 800 38px/1 var(--font-geez); text-align: center;
  animation: rise .4s both;
}
.orders .o small { display: block; font: 800 14px/1 var(--font-body); margin-top: 6px; color: var(--brown-dark); }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.8); } }

/* Monitor + keys (Computer) */
.monitor { max-width: 420px; margin: 0 auto; cursor: pointer; }
.screen {
  height: 220px; padding: 20px; text-align: left;
  background: #071426; border: 12px solid var(--ivory); border-radius: 22px;
  font: 700 18px/1.5 ui-monospace, Consolas, monospace; color: #7CF2A0;
  overflow: hidden; white-space: pre-wrap;
  box-shadow: 0 0 40px rgba(126,200,227,.25);
  transition: color .3s;
}
.caret { display: inline-block; width: 10px; height: 20px; background: currentColor; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.stand { width: 120px; height: 34px; margin: 0 auto; background: var(--ivory-2); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.keys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 440px; margin: 18px auto 0; }
.key {
  width: 38px; height: 38px; border-radius: 9px; border: 0; cursor: pointer;
  background: var(--ivory); color: var(--navy); font: 800 15px/1 var(--font-body);
  box-shadow: 0 4px 0 var(--ivory-2); transition: transform .08s, background .15s;
}
.key.on { background: var(--sky); transform: translateY(4px); box-shadow: none; }

/* Quiz (Math) */
.quiz {
  max-width: 420px; margin: 0 auto; padding: 28px 22px;
  background: var(--ivory); color: var(--navy); border-radius: 28px;
  box-shadow: 0 8px 0 var(--brown);
}
.quiz .q { font: 800 clamp(40px, 7vw, 58px)/1 var(--font-display); margin-bottom: 18px; }
.quiz .answers { display: flex; gap: 12px; justify-content: center; }
.quiz .answers button {
  width: 82px; height: 82px; border-radius: 50%; border: 0; cursor: pointer;
  font: 800 30px/1 var(--font-display); color: var(--navy);
  background: var(--sky); box-shadow: 0 6px 0 var(--sky-dark);
  transition: transform .15s;
}
.quiz .answers button:hover { transform: translateY(-4px) scale(1.06); }
.quiz .answers button.right { background: var(--green); color: #fff; box-shadow: 0 6px 0 #2F8A59; animation: pop .45s; }
.quiz .answers button.wrong { background: var(--red); color: #fff; box-shadow: 0 6px 0 #B34A3C; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.quiz .streak { margin-top: 16px; font-weight: 800; color: var(--brown-dark); min-height: 26px; }

/* Why-us flip cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 34px; }
.card {
  position: relative; height: 190px; border: 0; padding: 0; cursor: pointer;
  background: none; perspective: 900px; font: inherit; color: inherit;
}
.card .front, .card .back {
  position: absolute; inset: 0; border-radius: 26px; padding: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .6s cubic-bezier(.3, 1.4, .5, 1);
}
.card .front { background: #fff; border: 3px solid var(--navy); box-shadow: 0 6px 0 var(--navy); }
.card .front i { font-style: normal; font-size: 46px; line-height: 1; margin-bottom: 10px; transition: transform .3s; }
.card .front b { font: 800 22px/1.1 var(--font-display); }
.card .back {
  background: var(--navy); color: var(--ivory); font-weight: 700; font-size: 16px;
  transform: rotateY(180deg); box-shadow: 0 6px 0 var(--sky-dark);
}
.card:hover .front i { transform: scale(1.25) rotate(-10deg); }
.card.flipped .front { transform: rotateY(-180deg); }
.card.flipped .back { transform: rotateY(0); }

/* ---------- Contact ---------- */
#contact { background: linear-gradient(180deg, var(--navy), var(--navy-2)); }
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 50px; align-items: start; }
.info { display: grid; gap: 12px; margin: 20px 0; }
.info a {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 16px; text-decoration: none; color: var(--ivory);
  background: rgba(126, 200, 227, .1); border: 2px solid rgba(126, 200, 227, .25);
  transition: background .2s, transform .2s;
}
.info a:hover { background: rgba(126, 200, 227, .2); transform: translateX(6px); }
.info span { opacity: .7; font-weight: 700; }
.socials { display: flex; gap: 12px; flex-wrap: wrap; }
.social {
  display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800;
  padding: 10px 16px; border-radius: 14px; background: var(--ivory); color: var(--navy);
  box-shadow: 0 4px 0 var(--ivory-2); transition: transform .15s;
}
.social svg { width: 28px; height: 28px; }
.social:hover { transform: translateY(-3px) rotate(-2deg); }
.form {
  background: var(--ivory); color: var(--navy); border-radius: 28px; padding: 28px;
  box-shadow: 0 8px 0 var(--brown);
}
.form h3 { font-size: 28px; }
.form label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 14px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .row.three { grid-template-columns: 1.2fr 1.2fr .8fr; }
.form input, .form select, .form textarea {
  display: block; width: 100%; margin-top: 5px; padding: 12px 14px;
  font: 600 16px var(--font-body); color: var(--navy);
  background: #fff; border: 2px solid var(--ivory-2); border-radius: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(126, 200, 227, .3); }
.form .bad { border-color: var(--red); }
.send { width: 100%; }
.form-note { margin: 12px 0 0; font-weight: 700; min-height: 1.4em; }
.form-note.ok { color: #2F8A59; }
.form-note.err { color: #B34A3C; }
.form .botcheck { display: none; }

/* ---------- Class pages ---------- */
.class-hero {
  position: relative; overflow: hidden; padding: 70px 0 60px; text-align: center;
}
.class-hero h1 { font-size: clamp(38px, 7vw, 68px); }
.class-hero h1 .geez { display: block; font-size: .6em; color: var(--brown); margin-top: 6px; }
.class-hero p { font-size: 19px; max-width: 560px; margin-inline: auto; }
.class-page.tig .class-hero { background: radial-gradient(circle at 50% 120%, rgba(196,154,108,.45), var(--navy-2) 60%); }
.class-page.comp .class-hero { background: radial-gradient(circle at 50% 120%, rgba(126,200,227,.4), var(--navy) 60%); }
.class-page.mth .class-hero { background: radial-gradient(circle at 50% 120%, rgba(255,248,231,.25), var(--navy-2) 60%); }
.back {
  display: inline-block; margin-bottom: 20px; color: var(--sky); font-weight: 800; text-decoration: none;
  padding: 6px 14px; border-radius: 999px; border: 2px solid rgba(126, 200, 227, .4); transition: background .2s;
}
.back:hover { background: rgba(126, 200, 227, .15); }
.floaters span {
  position: absolute; font: 800 46px/1 var(--font-display); color: var(--ivory); opacity: .12;
  animation: bob 5s ease-in-out infinite;
}
.floaters.geez span { font-family: var(--font-geez); }
.floaters span:nth-child(1) { left: 6%; top: 20%; }
.floaters span:nth-child(2) { left: 18%; top: 70%; animation-delay: -1s; font-size: 60px; }
.floaters span:nth-child(3) { left: 80%; top: 18%; animation-delay: -2s; }
.floaters span:nth-child(4) { left: 90%; top: 65%; animation-delay: -3s; font-size: 64px; }
.floaters span:nth-child(5) { left: 34%; top: 12%; animation-delay: -4s; font-size: 34px; }
.floaters span:nth-child(6) { left: 66%; top: 78%; animation-delay: -2.5s; font-size: 38px; }
@keyframes bob { 50% { transform: translateY(-18px) rotate(8deg); } }

.learn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.learn > div {
  background: var(--ivory); color: var(--navy); border-radius: 24px; padding: 22px;
  box-shadow: 0 6px 0 var(--brown); transition: transform .2s;
}
.learn > div:hover { transform: translateY(-6px); }
.learn i { display: block; font-style: normal; font-size: 36px; line-height: 1; margin-bottom: 10px; }
.learn b { display: block; font: 800 20px/1.15 var(--font-display); margin-bottom: 6px; }
.learn p { margin: 0; font-size: 15px; color: var(--muted); }
.game, .pick { text-align: center; margin-top: 70px; }

.typer {
  max-width: 460px; margin: 0 auto; padding: 30px; border-radius: 28px;
  background: #071426; border: 3px solid var(--sky); box-shadow: 0 0 40px rgba(126,200,227,.25);
}
.typer .word { font: 800 52px/1 ui-monospace, Consolas, monospace; color: #7CF2A0; letter-spacing: 4px; margin-bottom: 18px; }
.typer .word.pop { animation: pop .45s; }
.typer input {
  width: 100%; padding: 14px; text-align: center; font: 700 26px ui-monospace, Consolas, monospace;
  border-radius: 14px; border: 3px solid var(--sky); background: var(--navy); color: var(--ivory);
}
.typer input:focus { outline: none; box-shadow: 0 0 0 4px rgba(126,200,227,.35); }
.typer .score { margin-top: 14px; font-weight: 800; color: var(--sky); }

.grades-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.grade {
  width: 140px; height: 124px; border-radius: 26px; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--sky); color: var(--navy); box-shadow: 0 7px 0 var(--sky-dark);
  transition: transform .15s;
}
.grade:nth-child(even) { background: var(--brown); box-shadow: 0 7px 0 var(--brown-dark); }
.grade:hover { transform: translateY(-6px) rotate(-3deg); }
.grade:active { transform: translateY(6px); box-shadow: none; }
.grade .n { font: 800 52px/1 var(--font-display); }
.grade .l { font-weight: 800; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .9, .3, 1.2); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Footer, toast, confetti ---------- */
footer { padding: 28px 0; text-align: center; font-size: 14px; opacity: .7; border-top: 1px solid rgba(126,200,227,.15); }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70;
  background: var(--ivory); color: var(--navy); font-weight: 800;
  padding: 12px 20px; border-radius: 14px; box-shadow: 0 5px 0 var(--brown);
}
.confetti { position: fixed; z-index: 80; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; }

/* ---------- Feyori the mascot (walks on the bottom edge of the window) ---------- */
.feyori {
  --char: 180px;
  position: fixed; left: 0; bottom: env(safe-area-inset-bottom, 0px); z-index: 40;
  width: calc(var(--char) * 1.2); height: calc(var(--char) * 1.8);
  margin-bottom: calc(var(--char) * -0.0667);
  pointer-events: none; will-change: transform;
}
.feyori[hidden] { display: none; }
.feyori-sprite {
  position: absolute; inset: 0; background-repeat: no-repeat; background-size: 800% 100%;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35));
}
.feyori.left .feyori-sprite { transform: scaleX(-1); }
.feyori-hit {
  position: absolute; left: 18%; width: 64%;
  bottom: calc(var(--char) * 0.0667); height: var(--char);
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; pointer-events: auto; border-radius: 40%;
}
.feyori-hit:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.bubble {
  position: absolute; left: 50%; bottom: calc(var(--char) * 1.1 + 6px); transform: translateX(-50%);
  width: max-content; max-width: 230px;
  background: var(--ivory); color: var(--navy);
  border: 3px solid var(--navy); border-radius: 20px; padding: 8px 14px; text-align: center;
  font-family: var(--font-display), var(--font-geez); font-weight: 700; font-size: 17px; line-height: 1.25;
  box-shadow: 0 4px 0 var(--brown);
}
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top-color: var(--navy); }
.sign {
  position: absolute; left: 50%; bottom: calc(var(--char) * 1.3 + 10px); transform: translateX(-50%);
  width: 260px; pointer-events: auto;
  background: var(--ivory); color: var(--navy);
  border: 4px solid var(--navy); border-radius: 18px; box-shadow: 0 6px 0 var(--brown);
  padding: 14px 14px 12px; text-align: center;
}
.sign b { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.15; }
.sign .geez { display: block; font-weight: 700; font-size: 15px; margin-top: 2px; }
.sign small { display: block; font-weight: 700; font-size: 13px; margin-top: 2px; }
.sign-btns { display: flex; gap: 8px; margin-top: 10px; }
.sign-btns a {
  flex: 1; text-decoration: none; font-weight: 800; font-size: 15px; color: var(--navy);
  padding: 7px 8px; border-radius: 12px; border: 3px solid var(--navy); background: #fff;
}
.sign-btns a:first-child { background: var(--sky); }
.sign .close {
  position: absolute; top: -14px; right: -14px; width: 30px; height: 30px;
  border-radius: 50%; border: 3px solid var(--navy); background: #fff; color: var(--navy);
  font: 800 16px/1 var(--font-body); cursor: pointer;
}

/* ---------- Phones and tablets ---------- */
@media (max-width: 900px) {
  .split, .contact { grid-template-columns: 1fr; }
  .split.flip > :first-child { order: 0; }
  .cards { grid-template-columns: 1fr 1fr; }
  .learn { grid-template-columns: 1fr 1fr; }
  .menu-btn { display: block; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; padding: 12px 16px 18px; gap: 6px;
    background: var(--navy); border-bottom: 2px solid rgba(126,200,227,.2);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; text-align: center; font-size: 17px; padding: 10px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards, .learn { grid-template-columns: 1fr; }
  .card { height: 150px; }
  .form { padding: 20px; }
  .form .row { grid-template-columns: 1fr; gap: 0; }
  .quiz .answers button { width: 70px; height: 70px; font-size: 26px; }
  .key { width: 30px; height: 32px; font-size: 13px; }
  .grade { width: 120px; height: 108px; }
  .feyori { --char: 110px; }
  .bubble { font-size: 14px; max-width: 170px; padding: 6px 10px; }
  .sign { width: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}


/* ===== Language switch ===== */
.brand-group { display: flex; align-items: center; gap: 14px; }
.lang-switch {
  position: relative; display: flex; width: 96px; height: 38px; padding: 3px;
  border: 0; border-radius: 999px; cursor: pointer; background: #34C759;
}
.lang-switch .pill {
  position: absolute; top: 3px; left: 3px; width: 45px; height: 32px; border-radius: 999px;
  background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25);
  transition: transform .25s cubic-bezier(.3,1.4,.6,1);
}
html[lang="ti"] .lang-switch .pill { transform: translateX(45px); }
.lang-switch .opt {
  position: relative; flex: 1; display: grid; place-items: center;
  font: 800 14px/1 var(--font-body); color: #fff; transition: color .2s;
}
.lang-switch .tg { font-family: var(--font-geez); }
html[lang="en"] .lang-switch .en, html[lang="ti"] .lang-switch .tg { color: #111; }

.lang-popup {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 25, 50, .75);
}
.lang-popup[hidden] { display: none; }
.lang-box {
  width: min(420px, 100%); padding: 28px 22px; border-radius: 24px; text-align: center;
  background: var(--ivory); color: var(--navy); box-shadow: 0 8px 0 var(--brown-dark);
  animation: popIn .35s ease-out;
}
.lang-box img { width: 120px; height: auto; }
.lang-box h2 { font-size: 26px; margin: 10px 0 4px; }
.lang-box p { margin: 0 0 20px; }
.lang-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lang-choice {
  padding: 18px 10px; border: 0; border-radius: 18px; cursor: pointer;
  font: 800 24px/1 var(--font-display); color: var(--navy);
  background: var(--sky); box-shadow: 0 5px 0 var(--sky-dark); transition: transform .15s;
}
.lang-choice:first-child { background: var(--brown); box-shadow: 0 5px 0 var(--brown-dark); }
.lang-choice.geez { font-family: var(--font-geez); }
.lang-choice:hover { transform: translateY(-3px); }
@keyframes popIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }


/* ===== Night sky behind the whole page ===== */
body { background: linear-gradient(180deg, #050E1E 0%, #0B1F3A 45%, #12305A 100%) fixed; }
.night-sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.night-sky canvas { position: absolute; top: 0; left: 0; will-change: transform; }
.sky-clouds { position: absolute; inset: 0; will-change: transform; }
.sky-clouds .cloud { opacity: .07; }

/* Sections: light see-through tints, different shades of blue */
.hero { background: rgba(27, 63, 112, .18); }
.subject.tig  { background: rgba(79, 166, 198, .10); }
.subject.comp {
  background:
    linear-gradient(rgba(126,200,227,.05) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(126,200,227,.05) 1px, transparent 1px) 0 0 / 32px 32px,
    rgba(18, 48, 90, .25);
}
.subject.mth  { background: rgba(126, 200, 227, .08); }
.band.light   { background: rgba(160, 215, 240, .10); color: var(--ivory); }
.band.light .tag { background: var(--sky); color: var(--navy); }
#contact      { background: rgba(27, 63, 112, .20); }
.class-page .class-hero { background: rgba(27, 63, 112, .20) !important; }
footer        { background: rgba(5, 14, 30, .45); }

/* keep white cards readable on the sky */
.card .front, .stat { color: var(--navy); }


/* words on Feyori's white board */
.board-text {
  position: absolute; left: 51%; top: 40.8%; transform: translate(-50%, -50%);
  width: calc(var(--char) * .42); text-align: center; pointer-events: none;
  font: 800 calc(var(--char) * .085)/1.05 var(--font-display); color: var(--navy);
}
.board-text[hidden] { display: none; }
.board-text .geez { display: block; font-family: var(--font-geez); color: #C0392B; }


/* ===== Day sky (Tigrinya page only) ===== */
.day-sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; display: none;
  background: linear-gradient(180deg, #5EC4F2 0%, #9EDCF7 55%, #D9F3FB 100%); }
body.day .day-sky { display: block; }
body.day .night-sky { display: none; }
.sun { position: absolute; top: 8%; right: 10%; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, #FFF4B0 0%, #FFD84D 55%, #FFC21A 100%);
  box-shadow: 0 0 60px 25px rgba(255, 216, 77, .55); animation: sunGlow 4s ease-in-out infinite alternate; }
@keyframes sunGlow { to { box-shadow: 0 0 80px 35px rgba(255, 216, 77, .75); } }
.day-stars i { position: absolute; width: 14px; height: 14px; background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 2.4s ease-in-out infinite alternate; }
.day-stars i:nth-child(odd) { animation-delay: -1.2s; width: 10px; height: 10px; }
.day-sky .cloud { background: #fff; opacity: .85; }
.village { position: absolute; left: 0; bottom: 8vh; width: 100%; height: 38vh; opacity: .9; filter: saturate(.85); }
.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 30vh; }
.leaves { position: absolute; inset: 0; }
.leaf { position: absolute; top: -60px; font-family: var(--font-geez); font-weight: 800;
  text-shadow: 0 2px 2px rgba(0,0,0,.15);
  animation-name: leafFall, leafSway; animation-timing-function: linear, ease-in-out;
  animation-iteration-count: 1, infinite; animation-direction: normal, alternate; }
@keyframes leafFall { to { top: 105vh; } }
@keyframes leafSway { from { transform: translateX(-30px) rotate(-35deg); } to { transform: translateX(30px) rotate(35deg); } }

/* Tigrinya page text dark so it reads on the bright sky */
body.day { color: var(--navy); }
body.day .class-hero { background: rgba(255, 255, 255, .18) !important; }
body.day .class-hero .back { color: var(--navy); }
body.day .class-page .band { background: rgba(255, 255, 255, .12); }
body.day .floaters span { color: var(--navy); opacity: .08; }
body.day footer { background: rgba(46, 110, 40, .85); color: #fff; }


/* ===== Math page background: navy + brown ===== */
.math-bg, .comp-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; display: none; }
body.math-mode .math-bg, body.comp-mode .comp-bg { display: block; }
body.math-mode .night-sky, body.comp-mode .night-sky { display: none; }
.math-bg {
  background:
    linear-gradient(rgba(196,154,108,.10) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(196,154,108,.10) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(180deg, #13284A, #0B1F3A 60%, #2A1C14);
}
.math-art { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.floaters-box { position: absolute; inset: 0; }
.float-up, .fall-down { position: absolute; font-weight: 800; animation-timing-function: linear; animation-iteration-count: 1; }
.float-up { bottom: -60px; font-family: var(--font-display); animation-name: floatUp; }
@keyframes floatUp { to { transform: translateY(-115vh) rotate(200deg); opacity: .2; } }
body.math-mode .class-hero { background: rgba(176, 125, 79, .18) !important; }
body.math-mode .class-page .band { background: rgba(11, 31, 58, .35); }
body.math-mode footer { background: #2A1C14; }

/* ===== Computer page background: purple + teal circuits ===== */
.comp-bg { background: linear-gradient(160deg, #1A0B3A 0%, #2A1060 45%, #0B3A3F 100%); }
.circuit { position: absolute; inset: 0; width: 100%; height: 100%; }
.circuit .pulse path { stroke-dasharray: 40 600; animation: pulse 3.5s linear infinite; }
.circuit .pulse path:nth-child(2) { animation-delay: -1.2s; }
.circuit .pulse path:nth-child(3) { animation-delay: -2.4s; }
@keyframes pulse { from { stroke-dashoffset: 640; } to { stroke-dashoffset: 0; } }
.fall-down { top: -60px; font-family: ui-monospace, Consolas, monospace; text-shadow: 0 0 8px currentColor; opacity: .75; animation-name: fallDown; }
@keyframes fallDown { to { transform: translateY(115vh); } }
body.comp-mode .class-hero { background: rgba(46, 230, 214, .08) !important; }
body.comp-mode .class-page .band { background: rgba(26, 11, 58, .35); }
body.comp-mode footer { background: #1A0B3A; }
body.comp-mode .typer { background: #12062A; border-color: #2EE6D6; }


/* centered "See ___ class" buttons under each subject */
.section-cta { text-align: center; margin-top: 36px; }


/* ===== 291 Academy App (green) ===== */
.app-btn {
  padding: 8px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  background: #34C759; color: #fff; font: 800 14px/1 var(--font-body);
  box-shadow: 0 3px 0 #23963F; transition: transform .15s;
}
.app-btn:hover { transform: translateY(-2px); }
.app-page .class-hero { background: rgba(52, 199, 89, .12) !important; }
.soon {
  display: inline-block; margin: 6px 0 14px; padding: 6px 16px; border-radius: 999px;
  background: #34C759; color: #fff; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 13px;
  animation: floaty 3s ease-in-out infinite;
}
.stores { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.store {
  padding: 10px 16px; border-radius: 14px; font-weight: 800; font-size: 15px;
  background: rgba(255,255,255,.08); border: 2px solid #34C759; color: var(--ivory);
}
.app-page .tag { background: #34C759; color: #fff; }
.app-steps { display: grid; gap: 50px; margin-top: 40px; }
.app-step { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.app-step:nth-child(even) .shot { order: 2; }
.shot { justify-self: center; max-width: 100%; border-radius: 22px; overflow: hidden;
  border: 4px solid #34C759; box-shadow: 0 12px 30px rgba(0,0,0,.4); background: #fff; }
.shot img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; }
.step-text b { display: block; font: 800 clamp(24px, 3vw, 32px)/1.15 var(--font-display); margin-bottom: 10px; color: #6EE08F; }
.step-text p { margin: 0; font-size: 18px; }
@media (max-width: 900px) {
  .app-step { grid-template-columns: 1fr; gap: 16px; text-align: center; }
  .app-step:nth-child(even) .shot { order: 0; }
  .app-btn { padding: 7px 10px; font-size: 12px; }
}
@media (max-width: 520px) {
  .app-btn { font-size: 0; padding: 8px 10px; }
  .app-btn::before { content: "📱 App"; font-size: 12px; }
}
.brand { white-space: nowrap; }
@media (max-width: 520px) {
  .brand-group { gap: 8px; }
  .brand { font-size: 21px; }
  .lang-switch { width: 84px; }
  .lang-switch .pill { width: 39px; }
  html[lang="ti"] .lang-switch .pill { transform: translateX(39px); }
}


/* App demo inside a phone frame */
.demo-phone {
  margin: 26px auto 18px; width: min(390px, 100%); height: 720px; max-height: 80vh;
  border: 12px solid #1d1d1f; border-radius: 42px; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 3px #34C759, 0 20px 50px rgba(0,0,0,.45);
}
.demo-phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.btn.demo-open { background: #34C759; color: #fff; box-shadow: 0 5px 0 #23963F; }


/* App ad (top of the App page) */
.app-ad {
  margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 18px 24px; border-radius: 24px;
  background: linear-gradient(120deg, #34C759, #1FA34A); color: #fff;
  box-shadow: 0 6px 0 #178A3C, 0 14px 30px rgba(0,0,0,.3);
}
.ad-label { display: block; font: 800 20px/1.1 var(--font-display); margin-bottom: 10px; }
.ad-facts { display: flex; gap: 14px; flex-wrap: wrap; }
.fact { background: rgba(255,255,255,.16); border-radius: 16px; padding: 8px 16px; text-align: center; min-width: 110px; }
.fact b { display: block; font: 800 26px/1.1 var(--font-display); }
.fact b.geez { font-family: var(--font-geez); }
.fact small { font-weight: 700; font-size: 13px; opacity: .95; }
.btn.ad-btn { background: #fff; color: #178A3C; box-shadow: 0 5px 0 #CDEFD6; }
@media (max-width: 600px) { .app-ad { justify-content: center; text-align: center; } .ad-facts { justify-content: center; } }

/* ===== Zoom the whole website a little (bigger on computers and tablets) ===== */
@media (min-width: 700px) {
  .top, main, footer { zoom: 1.1; }
}
