/* ====================== Tokens ====================== */
:root {
  --green: #01B701;
  --blue: #2EA9FE;
  --purple: #7C3AED;
  --pink: #E62A73;
  --gold: #FFCE29;
  --teal: #15B097;

  --ink: #221F1F;
  --ink-soft: #4E4949;
  --muted: #7A7474;
  --line: #EDF0F4;
  --surface: #FFFFFF;
  --bg: #FBFAFF;

  --grad: linear-gradient(120deg, var(--purple), var(--blue) 50%, var(--green));
  --grad-pink: linear-gradient(120deg, var(--pink), var(--purple));
  --shadow-sm: 0 4px 16px rgba(34, 31, 31, .06);
  --shadow-md: 0 12px 40px rgba(34, 31, 31, .10);
  --shadow-lg: 0 30px 70px rgba(124, 58, 237, .18);
  --radius: 22px;
  --maxw: 1140px;
  --header-h: 76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

html[dir="ltr"] body { font-family: 'Cairo', system-ui, sans-serif; }

h1, h2, h3 { font-family: 'Cairo', sans-serif; line-height: 1.25; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ====================== Animated gradient background blobs ====================== */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  z-index: -2;
  pointer-events: none;
}
body::before {
  width: 480px; height: 480px;
  background: radial-gradient(circle, var(--purple), transparent 70%);
  top: -160px; inset-inline-start: -120px;
  animation: float1 18s ease-in-out infinite;
}
body::after {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--blue), transparent 70%);
  bottom: -200px; inset-inline-end: -140px;
  animation: float2 22s ease-in-out infinite;
}
@keyframes float1 { 50% { transform: translate(80px, 60px) scale(1.15); } }
@keyframes float2 { 50% { transform: translate(-70px, -50px) scale(1.1); } }

/* ====================== Header ====================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: rgba(251, 250, 255, .72);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 38px; height: 38px; object-fit: contain; }
.brand-wordmark { height: 26px; width: auto; }
.nav-links { display: flex; gap: 26px; margin-inline-start: auto; }
.nav-links a {
  font-weight: 500; color: var(--ink-soft); font-size: 15px;
  position: relative; transition: color .2s;
}
.nav-links a::after {
  content: ""; position: absolute; bottom: -6px; inset-inline-start: 0;
  width: 0; height: 2px; background: var(--grad); border-radius: 2px;
  transition: width .25s;
}
.nav-links a:hover { color: var(--purple); }
.nav-links a:hover::after { width: 100%; }

.lang-toggle {
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 700; font-family: 'Cairo';
  width: 46px; height: 40px; border-radius: 12px; cursor: pointer;
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.lang-toggle:hover { border-color: var(--purple); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.lang-toggle:active { transform: scale(.95); }

/* ====================== Hero ====================== */
.hero { position: relative; padding: clamp(40px, 7vw, 90px) clamp(16px, 4vw, 40px) clamp(60px, 8vw, 110px); }
.hero-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px;
}
.hero-copy { animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }

.pill {
  display: inline-block; padding: 8px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 700; color: var(--purple);
  box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.hero-title { font-size: clamp(38px, 6vw, 66px); font-weight: 900; letter-spacing: -.5px; }
.grad {
  background: var(--grad); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.hero-sub { font-size: clamp(16px, 2vw, 19px); color: var(--ink-soft); margin: 22px 0 32px; max-width: 540px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.store-btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 13px 22px 13px 18px; border-radius: 16px;
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-md); overflow: hidden;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s;
}
.store-btn::before {
  content: ""; position: absolute; inset: 0; background: var(--grad);
  opacity: 0; transition: opacity .25s; z-index: 0;
}
.store-btn:hover { transform: translateY(-4px) scale(1.02); box-shadow: var(--shadow-lg); }
.store-btn:hover::before { opacity: 1; }
.store-btn svg, .store-btn span, .store-btn .soon { position: relative; z-index: 1; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.store-btn small { font-size: 11px; opacity: .85; }
.store-btn strong { font-size: 17px; font-family: 'Cairo'; }
.store-btn .soon {
  font-style: normal; font-size: 11px; font-weight: 700;
  background: var(--gold); color: var(--ink);
  padding: 3px 8px; border-radius: 999px; margin-inline-start: 4px;
}

.hero-stats { display: flex; gap: 32px; margin-top: 40px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat b { font-family: 'Cairo'; font-size: 30px; font-weight: 900;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 14px; color: var(--muted); }

/* Hero art */
.hero-art { position: relative; display: grid; place-items: center; animation: rise .9s .1s cubic-bezier(.2,.8,.2,1) both; }
.blob {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 42% 58% 56% 44% / 48% 42% 58% 52%;
  background: var(--grad); filter: blur(2px); opacity: .9;
  animation: morph 8s ease-in-out infinite, spin 26s linear infinite;
}
@keyframes morph {
  50% { border-radius: 58% 42% 44% 56% / 52% 58% 42% 48%; }
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-mascot { position: relative; width: 78%; max-width: 360px; filter: drop-shadow(0 24px 40px rgba(46,169,254,.35)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-16px); } }

/* ====================== Sections ====================== */
section { position: relative; }
.section-title { text-align: center; font-size: clamp(28px, 4vw, 44px); font-weight: 900; }
.section-sub { text-align: center; color: var(--muted); font-size: 17px; margin: 12px auto 50px; max-width: 560px; }

.features, .levels { max-width: var(--maxw); margin: 0 auto; padding: clamp(50px, 8vw, 90px) clamp(16px, 4vw, 40px); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: transparent; }
.feature-icon {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  font-size: 28px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--c) 14%, white);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 30%, transparent);
}
.feature-card h3 { font-size: 20px; margin-bottom: 8px; }
.feature-card p { color: var(--ink-soft); font-size: 15.5px; }

/* ====================== Levels ====================== */
.level-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.level-card {
  position: relative; border-radius: var(--radius); padding: 34px 28px; color: #fff;
  overflow: hidden; box-shadow: var(--shadow-md); isolation: isolate;
  transition: transform .25s;
}
.level-card:hover { transform: translateY(-8px) rotate(-.5deg); }
.level-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(120% 100% at 100% 0, rgba(255,255,255,.25), transparent 60%);
}
.lvl-beginner { background: linear-gradient(140deg, #2AC82A, #01A001); }
.lvl-intermediate { background: linear-gradient(140deg, #4FB7FE, #1F73AD); }
.lvl-advanced { background: linear-gradient(140deg, #915AF0, #5427A1); }
.level-tag {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  background: rgba(255,255,255,.22); font-weight: 700; font-size: 13px; margin-bottom: 16px;
  font-family: 'Cairo';
}
.level-card h3 { font-size: 23px; margin-bottom: 10px; }
.level-card p { font-size: 15.5px; opacity: .95; }

/* ====================== CTA ====================== */
.cta { max-width: var(--maxw); margin: 0 auto; padding: clamp(30px, 6vw, 60px) clamp(16px, 4vw, 40px) 90px; }
.cta-card {
  position: relative; overflow: hidden; border-radius: 32px;
  background: var(--grad); background-size: 200% 200%;
  animation: ctashift 8s ease infinite;
  padding: clamp(34px, 5vw, 56px);
  display: grid; grid-template-columns: 280px 1fr; align-items: center; gap: 30px;
  box-shadow: var(--shadow-lg);
}
@keyframes ctashift { 50% { background-position: 100% 50%; } }
.cta-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(60% 80% at 100% 0, rgba(255,255,255,.25), transparent);
}
.cta-mascot { position: relative; width: 100%; max-width: 260px; margin: 0 auto;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,.25)); animation: bob 4s ease-in-out infinite; }
.cta-copy { position: relative; color: #fff; }
.cta-copy h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; margin-bottom: 10px; }
.cta-copy p { font-size: 17px; opacity: .95; margin-bottom: 26px; max-width: 460px; }
.store-btn.dark { background: rgba(255,255,255,.16); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25); }
.store-btn.dark::before { background: #fff; }
.store-btn.dark:hover { color: var(--purple); }

/* ====================== Footer ====================== */
.site-footer { text-align: center; padding: 56px 20px 40px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand .brand-logo { width: 34px; height: 34px; }
.footer-brand .brand-wordmark { height: 24px; }
.footer-tag { color: var(--muted); margin-bottom: 20px; }
.footer-links { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.footer-links a { color: var(--ink-soft); font-weight: 500; transition: color .2s; }
.footer-links a:hover { color: var(--purple); }
.footer-copy { color: var(--muted); font-size: 14px; }
.footer-copy a { color: var(--purple); }

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

@keyframes rise { from { opacity: 0; transform: translateY(34px); } }

/* ====================== Privacy page ====================== */
.doc { max-width: 820px; margin: 0 auto; padding: clamp(40px, 6vw, 80px) clamp(16px, 4vw, 40px) 90px; }
.doc h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 900; margin-bottom: 8px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc .updated { color: var(--muted); margin-bottom: 36px; font-size: 14px; }
.doc h2 { font-size: 22px; margin: 34px 0 10px; }
.doc p, .doc li { color: var(--ink-soft); font-size: 16px; }
.doc ul { padding-inline-start: 22px; margin: 8px 0; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--purple); font-weight: 700; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--purple); font-weight: 700; margin-top: 40px; }

/* ====================== Responsive ====================== */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 2; }
  .hero-art { order: 1; }
  .hero-sub { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .level-grid { grid-template-columns: 1fr; }
  .cta-card { grid-template-columns: 1fr; text-align: center; }
  .cta-copy p { margin-inline: auto; }
  .cta-copy .hero-cta { justify-content: center; }
  .nav-links { display: none; }
}
@media (max-width: 540px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
