:root {
  --ground: #0B0E13;
  --surface: #121824;
  --surface-2: #182031;
  --line: #232c3d;
  --text: #EDF1F7;
  --muted: #98A2B5;
  --faint: #6B7487;
  --accent: #5B8DEF;
  --accent-ink: #0B0E13;
  --gold: #E9B65A;
  --radius: 18px;
  --gutter: 20px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--text);
  font: 500 17px/1.55 Heebo, system-ui, -apple-system, sans-serif;
  letter-spacing: 0; overflow-x: hidden;
}
html[lang="ar"] body { font-family: 'IBM Plex Sans Arabic', Heebo, system-ui, sans-serif; }
body.locked { overflow: hidden; }
a { color: inherit; }
svg { display: block; }
button { font: inherit; color: inherit; }

/* a quiet felt glow behind the hero: the one ambient light on the page */
body::before {
  content: ''; position: fixed; inset: -20vh -20vw auto; height: 90vh; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 55% at 50% 0%, rgba(91, 141, 239, .16), transparent 70%),
              radial-gradient(40% 40% at 80% 20%, rgba(18, 120, 90, .12), transparent 70%);
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  background: rgba(11, 14, 19, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(35, 44, 61, .6);
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 20px; }
.langs { position: relative; }
.langs summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted);
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.langs nav {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 170px; padding: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
  display: grid;
}
.langs nav a { padding: 10px 12px; border-radius: 9px; text-decoration: none; font-size: 15px; }
.langs nav a:hover, .langs nav a:focus-visible { background: rgba(91, 141, 239, .14); outline: none; }
.langs nav a[aria-current] { color: var(--accent); }
.langs nav a[lang="ar"] { font-family: 'IBM Plex Sans Arabic', sans-serif; }

/* ---------- layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 56px 0; }
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(34px, 8.6vw, 60px); }
h2 { font-size: clamp(28px, 6.4vw, 42px); }
h3 { font-size: 19px; }
.lead { color: var(--muted); font-size: clamp(17px, 2.2vw, 19px); margin: 16px 0 0; max-width: 36em; }
.fine { color: var(--faint); font-size: 14px; margin: 12px 0 0; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 14px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; }
html[dir="rtl"] .eyebrow { text-transform: none; letter-spacing: 0; }

/* ---------- hero ---------- */
.hero { display: grid; gap: 36px; align-items: center; padding-top: 36px; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr .85fr; gap: 56px; padding-top: 64px; } }
.try {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 0; border: 0; background: none;
  color: var(--accent); font-weight: 700; font-size: 16px; cursor: pointer;
}
.try svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.phone {
  position: relative; justify-self: center; width: min(300px, 78vw); aspect-ratio: 390 / 844; padding: 0; cursor: pointer;
  border-radius: 40px; border: 1px solid #2a3346; background: #05070a; overflow: hidden;
  box-shadow: 0 0 0 8px #151b27, 0 30px 80px rgba(0, 0, 0, .55), 0 0 90px rgba(91, 141, 239, .18);
  transition: transform .25s ease;
}
.phone:hover { transform: translateY(-4px); }
.phone img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- store buttons (drawn here; the official badge host was unreachable when this was built) ---------- */
.stores { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-width: 176px; padding: 9px 18px 9px 14px; text-decoration: none;
  background: #000; color: #fff; border: 1px solid #3b4252; border-radius: 12px; transition: border-color .2s, transform .2s;
}
html[dir="rtl"] .store { padding: 9px 14px 9px 18px; }
.store:hover { border-color: #8a93a6; transform: translateY(-1px); }
.store svg { width: 26px; height: 26px; flex: none; }
.store span { display: grid; line-height: 1.1; }
.store small { font-size: 11px; font-weight: 500; opacity: .9; }
.store b { font-size: 19px; font-weight: 700; font-family: -apple-system, 'SF Pro Display', Heebo, sans-serif; text-align: start; }
.store.match { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 141, 239, .22); }

/* ---------- the opening test ---------- */
.quiz { text-align: center; border-top: 1px solid var(--line); }
.quiz .lead { margin-inline: auto; }
.cta {
  margin-top: 26px; padding: 15px 44px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 18px;
  box-shadow: 0 12px 32px rgba(91, 141, 239, .35); transition: transform .2s;
}
.cta:hover { transform: translateY(-2px); }

/* ---------- features ---------- */
.feats { display: grid; gap: 14px; padding-top: 8px; }
@media (min-width: 760px) { .feats { grid-template-columns: repeat(3, 1fr); } }
.feats article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feats .ico {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; margin-bottom: 16px;
  background: rgba(91, 141, 239, .12);
}
.feats .ico svg:not(.mark) { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; }
.feats p { color: var(--muted); margin: 8px 0 0; font-size: 16px; }

/* ---------- quote ---------- */
.quote { margin: 0; padding: 56px 0; text-align: center; }
.quote p {
  margin: 0 auto; max-width: 18em; font-size: clamp(24px, 5vw, 36px); font-weight: 700; line-height: 1.25;
  background: linear-gradient(180deg, #fff, #aab5cc); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- get ---------- */
.get { text-align: center; border-top: 1px solid var(--line); padding-bottom: 64px; }
.get .mark { margin: 0 auto 18px; }
.get .lead { margin-inline: auto; }
.get .stores, .sheet .stores { justify-content: center; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); text-align: center; color: var(--faint); font-size: 13px; }
.foot p { margin: 6px 0; }
.foot .legal { color: var(--muted); }
.foot .links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.foot .links a { text-decoration: none; }
.foot .links a:hover { color: var(--text); }

/* ---------- the test overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(4, 6, 9, .86); display: grid; place-items: center; }
.overlay[hidden], .sheet-wrap[hidden] { display: none; }
.overlay .frame { display: flex; flex-direction: column; width: 100%; height: 100%; background: #05070a; }
.overlay .bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px 16px; background: var(--ground); border-bottom: 1px solid var(--line);
}
html[dir="rtl"] .overlay .bar { padding: calc(6px + env(safe-area-inset-top)) 16px 6px 12px; }
.overlay .bar .logo { font-size: 15px; font-weight: 700; }
.overlay iframe { flex: 1; width: 100%; border: 0; background: #05070a; }
.x { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.x:hover { background: rgba(255, 255, 255, .08); }
.x svg { width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
@media (min-width: 700px) and (min-height: 700px) {
  .overlay .frame {
    width: clamp(380px, calc((100vh - 48px) * 0.48), 430px); height: min(900px, calc(100vh - 48px));
    border-radius: 28px; overflow: hidden; border: 1px solid #2a3346; box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  }
  .overlay .bar { padding-top: 6px; }
}

/* ---------- the download sheet after the test ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(4, 6, 9, .72); display: grid; align-items: end; justify-items: center; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } }
.sheet {
  position: relative; width: min(520px, 100%); text-align: center; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 34px 24px calc(28px + env(safe-area-inset-bottom));
  animation: up .32s cubic-bezier(.2, .8, .2, 1);
}
@media (min-width: 700px) { .sheet { border-radius: 24px; padding-bottom: 30px; } }
.sheet .mark { margin: 0 auto 14px; }
.sheet h2 { font-size: 26px; }
.sheet .x { position: absolute; top: 10px; inset-inline-end: 10px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- root language picker (no-JS fallback) ---------- */
body.root .pick { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; }
body.root .pick nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
body.root .pick a { padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
