/* kafzoon.com: one stylesheet for every page (copied to /assets/site.css by tools/site/build.py).
   Colours: the app's own (app/shared/.../menus/MenuStyle.kt) and the logo's, from the shared doc's
   design tab. Layout uses logical properties (inline-start/end), so the same rules serve Arabic
   (right to left) and English and German (left to right). */

@font-face {
  font-family: "Baloo Bhaijaan 2"; font-weight: 500; font-display: swap;
  src: url("/fonts/BalooBhaijaan2-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Baloo Bhaijaan 2"; font-weight: 700; font-display: swap;
  src: url("/fonts/BalooBhaijaan2-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Lalezar"; font-weight: 400; font-display: swap;
  src: url("/fonts/Lalezar-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Baloo Bhaijaan 2"; font-weight: 800; font-display: swap;
  src: url("/fonts/BalooBhaijaan2-ExtraBold.ttf") format("truetype");
}

:root {
  color-scheme: light;
  /* sky and grass, as in the app's backgrounds */
  --sky: #2f90fa;
  --sky-deep: #1667c9;
  --sky-100: #d6f0ff;
  --sky-50: #eef8ff;
  --grass: #90dc75;
  --grass-deep: #6cc75a;
  --go: #32be5f;
  /* the logo's warm letters: buttons, small titles and decoration only */
  --sun: #fac644;
  --coral: #f36b52;
  --mint: #87d4b5;
  /* text */
  --ink: #1f386b;
  --text: #24334f;
  --muted: #56657f;
  --line: #dde9f6;
  /* the games' colours (Content/games.json -> MenuStyle.kt) */
  --g-purple: #8561f0;
  --g-ink: #1f386b;
  --g-green: #2ebd5c;
  --g-pink: #fa5c85;
  --g-teal: #1ab8b8;
  --g-orange: #ff991a;
  --g-blue: #298ffa;

  --font: "Baloo Bhaijaan 2", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --radius-lg: 30px;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(31, 56, 107, .06), 0 12px 32px rgba(31, 56, 107, .10);
  --shadow-lift: 0 2px 4px rgba(31, 56, 107, .08), 0 20px 44px rgba(31, 56, 107, .16);
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--text);
  font-family: var(--font); font-weight: 500; font-size: 17px; line-height: 1.75;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--sky-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { color: var(--ink); line-height: 1.3; margin: 0; font-weight: 800; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 12px; text-decoration: none;
}
.skip:focus { top: 12px; color: #fff; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid rgba(221, 233, 246, .8);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 20px; min-height: 68px;
  padding-top: env(safe-area-inset-top, 0px);
}
.brand { display: flex; align-items: flex-end; gap: 6px; flex: none; text-decoration: none; padding-bottom: 6px; }
.brand-icon { height: 52px; width: auto; }
/* The boy holds his balloon towards the reading direction's end, as in each logo. */
[dir="ltr"] .brand-icon { transform: scaleX(-1); }
.wordmark { height: 34px; width: auto; }
.wordmark.latin {
  height: auto; font-family: "Lalezar", var(--font); font-size: 1.85rem; line-height: 1; letter-spacing: .02em;
  padding-top: 6px;
}
.mainnav { display: flex; gap: 4px; margin-inline-start: 8px; }
.mainnav a {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: .98rem;
  padding: 6px 14px; border-radius: 999px;
}
.mainnav a:hover { background: var(--sky-50); }
.langs {
  margin-inline-start: auto; display: flex; gap: 2px; padding: 4px;
  background: var(--sky-50); border: 1px solid var(--line); border-radius: 999px;
}
.langs a {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: .92rem;
  padding: 3px 13px; border-radius: 999px; line-height: 1.9; white-space: nowrap;
}
.langs a:hover { background: #fff; }
.langs a[aria-current] { background: var(--sky); color: #fff; box-shadow: 0 2px 6px rgba(47, 144, 250, .35); }
.langs .full { display: inline; }
.langs .short { display: none; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, #b9dcfa 0%, #dff0ff 100%); }
.hero-art img {
  width: 100%; height: auto; aspect-ratio: 3840 / 1646; object-fit: cover; object-position: 56% 60%;
}
.hero-body {
  background: linear-gradient(180deg, var(--grass-deep) 0, var(--grass-deep) 46px, #fff 46px);
  padding-bottom: clamp(40px, 6vw, 72px);
}
.hero-card {
  position: relative; max-width: 860px; margin: clamp(-120px, -8vw, -48px) auto 0;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  padding: clamp(26px, 4vw, 44px) clamp(20px, 5vw, 56px); text-align: center;
}
.hero-card h1 { font-size: clamp(1.85rem, 4.4vw, 3.05rem); letter-spacing: -.01em; }
.hero-card .lead { margin: 14px auto 0; max-width: 640px; color: var(--muted); font-size: clamp(1.02rem, 1.6vw, 1.18rem); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.chips li {
  font-weight: 700; font-size: .92rem; color: var(--ink); padding: 3px 14px; border-radius: 999px;
}
.chips li:nth-child(1) { background: #fff1c8; }
.chips li:nth-child(2) { background: #ffe0d9; }
.chips li:nth-child(3) { background: #d9f3e8; }

.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.badges a { display: block; border-radius: 10px; transition: transform .15s ease; }
.badges a:hover { transform: translateY(-2px); }
.badges img { height: 54px; width: auto; }

/* ---------- sections ---------- */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section.tint { background: var(--sky-50); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(28px, 4vw, 48px); }
.eyebrow {
  display: inline-block; font-weight: 800; font-size: .9rem; letter-spacing: .02em;
  color: var(--coral); background: #ffe9e4; padding: 2px 14px; border-radius: 999px; margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }

/* games */
.games { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; padding: 0; margin: 0; list-style: none; }
.games > li { flex: 1 1 236px; max-width: 262px; }
.game {
  --c: var(--g-purple);
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.game:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.game-art {
  height: 148px; display: grid; place-items: center; position: relative; overflow: hidden;
  background: var(--c);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 78%);
}
.game-art svg { width: 100%; height: 100%; }
.game-art .emoji { font-size: 58px; line-height: 1; display: flex; gap: 6px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .16)); }
.game-body { padding: 16px 20px 20px; }
.game h3 { font-size: 1.18rem; }
.game p { margin-top: 4px; color: var(--muted); font-size: .97rem; line-height: 1.65; }
.balloon { transform-box: fill-box; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .game:hover .balloon { animation: bob 1.6s ease-in-out infinite; }
  .game:hover .balloon:nth-child(2) { animation-delay: .2s; }
  .game:hover .balloon:nth-child(3) { animation-delay: .4s; }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* how it works */
.how { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.video {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lift); background: #0d1b33;
  aspect-ratio: 16 / 9;
}
.video video { width: 100%; height: 100%; object-fit: cover; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.steps li::before {
  counter-increment: step; content: counter(step);
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 1.35rem; color: #fff; background: var(--sky);
  box-shadow: 0 6px 14px rgba(47, 144, 250, .32);
}
.steps li:nth-child(2)::before { background: var(--g-orange); box-shadow: 0 6px 14px rgba(255, 153, 26, .32); }
.steps li:nth-child(3)::before { background: var(--go); box-shadow: 0 6px 14px rgba(50, 190, 95, .32); }
.steps h3 { font-size: 1.15rem; margin-top: 8px; }
.steps p { color: var(--muted); margin-top: 2px; }

/* for parents */
.trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; list-style: none; margin: 0; padding: 0; }
.trust li {
  display: grid; grid-template-columns: 58px 1fr; gap: 16px; align-items: start;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.trust .icon {
  width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; font-size: 28px;
  background: var(--sky-50);
}
.trust li:nth-child(2) .icon { background: #e6f7ef; }
.trust li:nth-child(3) .icon { background: #fff4d6; }
.trust li:nth-child(4) .icon { background: #ffe9e4; }
.trust h3 { font-size: 1.12rem; margin-top: 4px; }
.trust p { color: var(--muted); margin-top: 2px; font-size: .98rem; }

/* free band */
.free {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(135deg, var(--sky-100), #e9f7ff 60%, #fff6d9);
  border-radius: var(--radius-lg); padding: clamp(32px, 5vw, 56px) clamp(20px, 5vw, 64px);
}
.free h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
.free p { max-width: 620px; margin: 10px auto 0; color: var(--muted); font-size: 1.08rem; }
.free .deco { position: absolute; width: 110px; opacity: .9; pointer-events: none; }
.free .deco.one { inset-inline-start: 3%; top: 14%; }
.free .deco.two { inset-inline-end: 3%; bottom: 8%; width: 90px; }

/* screenshots */
.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); list-style: none; margin: 0 auto; padding: 0; max-width: 860px; }
.shots figure { margin: 0; text-align: center; }
.shots img {
  width: 100%; height: auto; border-radius: clamp(20px, 3vw, 34px);
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--line), var(--shadow-lift);
}
.shots figcaption { margin-top: 18px; font-weight: 700; color: var(--ink); }

/* questions */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 18px; transition: box-shadow .2s ease; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 22px; font-weight: 700; color: var(--ink); font-size: 1.06rem;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sky-50); color: var(--sky-deep); font-size: 1.3rem; line-height: 1; transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 18px; color: var(--muted); }

/* ---------- footer ---------- */
.footer { margin-top: clamp(40px, 6vw, 80px); }
.footer .hills { display: block; width: 100%; height: clamp(48px, 7vw, 96px); }
.footer-body { background: var(--grass); color: var(--ink); padding-block: 8px 40px; }
.footer-body .wrap { display: grid; gap: 18px; justify-items: center; text-align: center; }
.footer-brand { background: #fff; border-radius: 999px; padding: 10px 22px 10px 18px; box-shadow: 0 6px 16px rgba(31, 56, 107, .12); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.footer-links a, .footer-mail a { color: var(--ink); font-weight: 700; text-decoration: none; }
.footer-links a:hover, .footer-mail a:hover { text-decoration: underline; }
.footer-small { font-size: .85rem; line-height: 1.7; color: #2b4a3a; max-width: 760px; }

/* ---------- parents' pages (privacy, terms, support, licences) ---------- */
.page-head { background: linear-gradient(180deg, var(--sky-100), var(--sky-50)); padding-block: clamp(36px, 6vw, 64px) clamp(56px, 8vw, 96px); text-align: center; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-head .meta { margin-top: 8px; color: var(--muted); }
.page-head .others { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; align-items: center; color: var(--muted); font-size: .95rem; }
.page-head .others a {
  text-decoration: none; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--line);
  padding: 2px 14px; border-radius: 999px;
}
.doc {
  max-width: 820px; margin: clamp(-64px, -6vw, -40px) auto 0; position: relative;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 48px) clamp(20px, 5vw, 56px);
}
.doc + .doc { margin-top: 24px; }
.doc h2 { font-size: 1.45rem; margin-bottom: 6px; }
.doc .intro { color: var(--muted); margin-bottom: 18px; font-size: 1.05rem; }
.doc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.doc li { padding-inline-start: 18px; border-inline-start: 4px solid var(--sky-100); }
.doc li strong { color: var(--ink); }
.doc .who { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
.doc pre {
  direction: ltr; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.6;
  background: var(--sky-50); border-radius: 16px; padding: 18px; margin: 12px 0 0; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.doc a { overflow-wrap: anywhere; }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  .mainnav { display: none; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand-icon { height: 46px; }
  .wordmark { height: 28px; }
  .wordmark.latin { font-size: 1.55rem; }
  .langs .full { display: none; }
  .langs .short { display: inline; }
  .hero-art img { aspect-ratio: 4 / 3; }
  .trust { grid-template-columns: 1fr; }
  .games > li { max-width: none; }
  .game-art { height: 132px; }
  .badges img { height: 48px; }
  .shots { grid-template-columns: repeat(3, minmax(150px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 16px; }
  .shots li { scroll-snap-align: center; }
  .free .deco { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
