:root {
  --blue: #1e6ff1;
  --blue-dark: #1556c4;
  --sky: #36b5f7;
  --yellow: #facc15;
  --ink: #0f1b2d;
  --text: #3b4a5e;
  --muted: #5a6a80;
  --line: #e3e9f2;
  --tint: #f3f7fd;
  --white: #ffffff;
  --danger: #d93a3a;
  --success: #1f9d55;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(780px, 100% - 40px); }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 1.25rem; text-decoration: none; }
.brand img { border-radius: 10px; }
.nav { display: flex; gap: 18px; margin-left: auto; }
.header__cta { flex: none; }
.nav a { padding: 10px 0; color: var(--text); font-weight: 600; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); }
.langs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--tint); }
.langs a { min-width: 44px; padding: 8px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; line-height: 1; text-align: center; color: var(--muted); text-decoration: none; }
.langs a.is-active { background: var(--white); color: var(--blue); box-shadow: 0 1px 3px rgba(15, 27, 45, .12); }

/* Hero */
.hero {
  color: var(--white);
  background: linear-gradient(135deg, var(--blue) 0%, var(--sky) 100%);
  overflow: hidden;
}
.hero__inner { display: grid; grid-template-columns: 1fr 470px; align-items: center; gap: 40px; padding: 64px 0 72px; }
.hero h1 { color: var(--white); }
.hero .lead { color: rgba(255, 255, 255, .92); }
.hero__art { position: relative; width: 470px; height: 600px; }
.hero__mascot { position: absolute; left: -70px; bottom: -24px; z-index: 3; width: 150px; filter: drop-shadow(0 16px 24px rgba(9, 40, 110, .35)); }
.pill {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 800;
}
.lead { font-size: 1.15rem; max-width: 60ch; }

/* Store badges */
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 178px;
  padding: 9px 18px 9px 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 14px;
  background: #000;
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(9, 40, 110, .25);
}
.store:hover { color: var(--white); background: #1a1a1a; }
.store__icon { flex: none; }
.store__text { display: grid; line-height: 1.1; white-space: nowrap; }
.store__text small { font-size: .72rem; font-weight: 600; opacity: .85; }
.store__text strong { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.store--soon { cursor: default; }
.store--soon .store__icon, .store--soon .store__text strong { opacity: .75; }
.store--soon .store__text small { color: var(--yellow); opacity: 1; font-weight: 800; }
.stores__note { margin: 14px 0 0; font-size: .95rem; color: rgba(255, 255, 255, .92); }
.stores__note a { color: var(--white); font-weight: 800; }
.page .stores__note { color: var(--text); }
.page .stores__note a { color: var(--blue); }

/* Buttons */
.button {
  display: inline-block;
  padding: 13px 26px;
  border: 0;
  border-radius: 14px;
  background: var(--blue);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--blue-dark); color: var(--white); }
.button--light { background: var(--white); color: var(--blue); }
.button--light:hover { background: var(--tint); color: var(--blue-dark); }
.button--danger { background: var(--danger); }
.button--danger:hover { background: #b62e2e; }
.button--small { padding: 9px 18px; border-radius: 12px; font-size: .95rem; }

/* Sections */
.section { padding: 72px 0; }
.section--tint { background: var(--tint); }
.grid { display: grid; gap: 20px; margin-top: 28px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.card p { margin: 0; }
.card__num {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
}

.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { display: flex; justify-content: space-between; gap: 16px; color: var(--ink); font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--blue);
  font-size: 1.2rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 10px 0 0; }

.cta {
  padding: 48px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--sky) 100%);
  color: var(--white);
  text-align: center;
}
.cta h2 { color: var(--white); }
.cta--download { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 36px; text-align: left; }
.cta--download p { max-width: 56ch; color: rgba(255, 255, 255, .92); }
.cta--download .stores { margin-top: 20px; }
.cta__mascot { width: 200px; filter: drop-shadow(0 16px 24px rgba(9, 40, 110, .35)); }

/* Phone mockup: a static copy of the app screens, colours from bilbol_mobile/constants/colors.ts */
.sprite { position: absolute; overflow: hidden; }
.phone {
  position: absolute;
  width: 270px;
  height: 568px;
  padding: 9px;
  border-radius: 46px;
  background: #0b1b3f;
  box-shadow: inset 0 0 0 2px #2a3d66, 0 40px 80px rgba(9, 40, 110, .45);
}
.phone--front { right: 0; top: 0; z-index: 2; }
.phone--back { left: 30px; top: 40px; z-index: 1; transform: rotate(-8deg) scale(.88); transform-origin: bottom left; }
.phone__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 37px;
  background: #f4f8ff;
  color: #0b1b3f;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  line-height: 1.3;
}
.phone__island { position: absolute; top: 9px; left: 50%; width: 78px; height: 22px; margin-left: -39px; border-radius: 999px; background: #000; }
.m-i { width: 14px; height: 14px; flex: none; }
.m-muted { color: #94a3b8; }
.m-status { display: flex; align-items: center; justify-content: space-between; padding: 11px 22px 6px 26px; font-size: 12px; font-weight: 800; }
.m-status__bat { width: 22px; height: 11px; border: 1.5px solid #0b1b3f; border-radius: 3px; position: relative; }
.m-status__bat::after { content: ""; position: absolute; inset: 1.5px 5px 1.5px 1.5px; border-radius: 1px; background: #0b1b3f; }

.m-topbar {
  display: flex;
  align-items: center;
  align-self: flex-start;
  margin: 6px 12px 8px;
  padding: 3px 4px;
  border: 1px solid #dce6f7;
  border-radius: 14px;
  background: #fff;
}
.m-topbar img { width: 22px; height: 22px; margin: 0 4px; }
.m-topbar .m-stat { padding: 3px 7px; border-left: 1px solid #dce6f7; }
.m-stat { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 11.5px; }
.m-stat--streak { color: #fb923c; }
.m-stat--xp { color: #0ea5e9; }
.m-stat--gem { color: #f59e0b; }
.m-stat--heart { color: #ef4444; }

.m-body { flex: 1; overflow: hidden; padding: 0 12px; }
.m-hero { display: grid; gap: 7px; padding: 13px; border-radius: 18px; background: linear-gradient(135deg, #1e6ff1, #38bdf8); color: #fff; }
.m-hero__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-hero__title { display: block; font-size: 18px; font-weight: 800; }
.m-hero__sub { display: block; font-size: 11px; font-weight: 600; opacity: .9; }
.m-hero__mascot { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: #fff; }
.m-hero__mascot img { width: 36px; height: 36px; }
.m-chip { justify-self: start; padding: 5px 10px; border-radius: 999px; background: #fff; color: #0b1b3f; font-size: 11px; font-weight: 700; }
.m-chip b { margin-left: 4px; color: #1e6ff1; }
.m-hero__stats { display: flex; flex-wrap: wrap; gap: 6px; }
.m-hero__stats span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 10.5px; font-weight: 700; }
.m-hero__stats .m-i { width: 12px; height: 12px; }

.m-card { border-radius: 16px; background: #fff; box-shadow: 0 5px 12px rgba(15, 61, 140, .08); }
.m-goal { display: grid; gap: 7px; margin: 10px 0 12px; padding: 11px 12px; }
.m-goal__row { display: flex; justify-content: space-between; font-size: 11.5px; }
.m-goal__row span { color: #5b6b8c; font-weight: 700; }
.m-progress { height: 9px; flex: 1; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.m-progress span { display: block; height: 100%; border-radius: inherit; background: #58cc02; }
.m-progress--thin { height: 5px; }
.m-title { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 800; }
.m-subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.m-subject { display: grid; gap: 5px; padding: 10px; }
.m-subject strong { min-height: 28px; font-size: 11.5px; line-height: 1.2; }
.m-subject small { color: #5b6b8c; font-size: 9.5px; font-weight: 600; }
.m-subject__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, white); }
.m-subject__icon .m-i { width: 19px; height: 19px; }
.m-subject .m-progress span { background: var(--accent); }
.m-subject--1 { --accent: #1e6ff1; }
.m-subject--2 { --accent: #f97316; }
.m-subject--3 { --accent: #8b5cf6; }
.m-subject--4 { --accent: #16a34a; }

.m-tabs { display: flex; justify-content: space-around; padding: 8px 6px 16px; border-top: 1px solid #dce6f7; background: #fff; }
.m-tabs span { display: grid; justify-items: center; gap: 2px; color: #94a3b8; font-size: 9.5px; font-weight: 700; }
.m-tabs .m-i { width: 18px; height: 18px; }
.m-tabs .is-active { color: #1e6ff1; }

.m-lesson__bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px 4px; }
.m-lesson__bar .m-progress { height: 12px; }
.m-lesson__prompt { margin: 14px 16px 6px; color: #5b6b8c; font-size: 12px; font-weight: 700; }
.m-lesson__question { margin: 0 16px; padding: 26px 0; border-radius: 18px; background: #fff; box-shadow: 0 5px 12px rgba(15, 61, 140, .08); font-size: 30px; font-weight: 800; text-align: center; }
.m-options { display: grid; gap: 9px; margin: 14px 16px 0; }
.m-option { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 3px solid #dce6f7; border-radius: 16px; background: #fff; font-size: 16px; font-weight: 700; }
.m-option__badge { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f4f8ff; color: #5b6b8c; font-size: 12px; font-weight: 800; }
.m-option--correct { border-color: #16a34a; background: #dcfce7; }
.m-option--correct .m-option__badge { background: #16a34a; color: #fff; }
.m-option__check { width: 20px; height: 20px; margin-left: auto; color: #16a34a; }
.m-feedback { display: grid; gap: 10px; margin-top: auto; padding: 14px 16px 22px; background: #dcfce7; }
.m-feedback strong { display: flex; align-items: center; gap: 6px; color: #15803d; font-size: 14px; font-weight: 800; }
.m-feedback strong .m-i { width: 18px; height: 18px; color: #16a34a; }
.m-feedback__button { padding: 11px; border-radius: 14px; background: #58cc02; box-shadow: 0 4px 0 #46a302; color: #fff; font-size: 13px; font-weight: 800; text-align: center; }

/* Inner pages */
.page { padding: 56px 0 80px; }
.page h2 { margin-top: 1.8em; }
.muted { color: var(--muted); font-size: .95rem; }
.list { padding-left: 1.2em; }
.list li { margin-bottom: .4em; }
.steps { padding-left: 1.3em; }
.steps li { margin-bottom: .6em; }

.legal h2 { font-size: 1.3rem; }
.legal table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: .95rem; }
.legal th, .legal td { padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal th { background: var(--tint); color: var(--ink); }

.contact-card {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--tint);
  font-weight: 700;
}
.contact-card a { font-size: 1.1rem; }

.box { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); margin: 24px 0; }
.box--success { border-color: var(--success); background: #effaf3; }
.box h2, .box h3 { margin-top: 0; }

/* Forms */
.form { display: grid; gap: 16px; margin-top: 16px; }
.field label { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 700; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #cfd8e6;
  border-radius: 12px;
  font: inherit;
  background: var(--white);
}
.field input:focus, .field select:focus { outline: 3px solid rgba(30, 111, 241, .25); border-color: var(--blue); }
.field small { display: block; margin-top: 4px; color: var(--muted); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--danger); cursor: pointer; }
.form + p { margin-top: 18px; }
.note { padding: 12px 16px; border-left: 4px solid var(--danger); border-radius: 8px; background: #fdf3f3; color: var(--ink); font-weight: 600; }
.alert { padding: 12px 16px; border-radius: 12px; background: #fdeeee; color: var(--danger); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.invite { text-align: center; }
.invite__logo { border-radius: 26px; margin-bottom: 16px; }
.invite__stores .stores { justify-content: center; }

/* Footer */
.footer { padding: 40px 0; background: var(--ink); color: rgba(255, 255, 255, .75); font-size: .95rem; }
.footer__inner { display: grid; gap: 18px; }
.footer__brand { display: flex; align-items: center; gap: 10px; color: var(--white); font-weight: 800; font-size: 1.1rem; }
.footer__brand img { border-radius: 8px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer a { color: rgba(255, 255, 255, .85); }
.footer a:hover { color: var(--white); }
.footer__copy { margin: 0; }

@media (max-width: 1040px) {
  .hero__inner { grid-template-columns: 1fr 300px; }
  .hero__art { width: 300px; }
  .phone--back { display: none; }
  .hero__mascot { left: -50px; width: 140px; }
}

@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .header { position: static; }
  .header__inner { flex-wrap: wrap; gap: 4px 12px; padding: 8px 0 0; }
  .nav { order: 3; flex: 1; margin-left: 0; }
  .header__cta { order: 4; margin-bottom: 4px; }
  .langs { margin-left: auto; }
  .hero__inner { grid-template-columns: 1fr; padding: 48px 0 0; text-align: left; }
  .hero__art { justify-self: center; width: 280px; height: 430px; }
  .phone--front { right: 5px; }
  .hero__mascot { display: none; }
  .grid--4, .grid--3 { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .cta { padding: 32px 22px; }
  .cta--download { grid-template-columns: 1fr; justify-items: center; gap: 12px; text-align: center; }
  .cta--download .stores { justify-content: center; }
  .cta__mascot { width: 130px; }
  .store { min-width: 0; flex: 1 1 150px; gap: 8px; padding: 8px 12px 8px 10px; }
  .store__text strong { font-size: 1.12rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .store, .langs a { transition: background-color .15s ease, color .15s ease; }
}
