/* Family Tree site — one stylesheet for every page.
   Colours follow the app's default "Dawn" theme plus the green of the app icon. */

@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap; src: url("/assets/fonts/tajawal-regular.woff2") format("woff2"); }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url("/assets/fonts/tajawal-medium.woff2") format("woff2"); }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url("/assets/fonts/tajawal-bold.woff2") format("woff2"); }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url("/assets/fonts/tajawal-extrabold.woff2") format("woff2"); }

:root {
  --bg: #f4f9f9;
  --bg-alt: #e6f2f1;
  --surface: #ffffff;
  --surface-2: #f0f4f7;
  --border: #d3e3e2;
  --ink: #0f2423;
  --ink-2: #3a5453;
  --ink-3: #566f6e;
  --navy: #1a6b6a;
  --teal: #1a6b6a;
  --teal-soft: #dff2f1;
  --green: #1b5e20;
  --green-soft: #e8f5e9;
  --dawn: #7be8e0;
  --gold: #a8741f;
  --red: #c62828;
  --night-0: #071a19;
  --night-1: #103b3a;
  --night-2: #1a6b6a;
  --on-dark: #ecf7f6;
  --on-dark-2: #b4d3d1;
  --link: #1a6b6a;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --shadow-1: 0 1px 2px rgb(15 36 35 / .06), 0 2px 8px rgb(15 36 35 / .05);
  --shadow-2: 0 4px 12px rgb(15 36 35 / .08), 0 16px 40px rgb(15 36 35 / .10);
  --shadow-3: 0 10px 30px rgb(7 26 25 / .25), 0 40px 80px rgb(7 26 25 / .30);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;
  --font: "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1716;
    --bg-alt: #0e1f1e;
    --surface: #122927;
    --surface-2: #183230;
    --border: #244542;
    --ink: #e6f3f2;
    --ink-2: #b2cfcd;
    --ink-3: #8aaaa8;
    --teal: #7fd8d3;
    --teal-soft: #163e3c;
    --green: #81c784;
    --green-soft: #183320;
    --gold: #e3c27a;
    --red: #ef9a9a;
    --link: #7fd8d3;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-2: 0 8px 30px rgb(0 0 0 / .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body, html[lang="fr"] body { line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--dawn); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 8px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease), backdrop-filter .3s;
}
.site-header.solid, .page-legal .site-header {
  background: rgb(16 59 58 / .88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  box-shadow: 0 1px 0 rgb(255 255 255 / .06);
}
.site-header .container { display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.site-header .brand { min-width: 0; flex: 0 1 auto; }
.brand img { flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 2px 8px rgb(0 0 0 / .3); }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { color: var(--on-dark-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; transition: color .2s, background-color .2s; }
.nav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.lang-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid rgb(255 255 255 / .2); border-radius: 999px; }
.lang-switch a { color: var(--on-dark-2); text-decoration: none; font-size: .85rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.lang-switch a[aria-current="true"] { background: rgb(255 255 255 / .16); color: #fff; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: .95rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
}
.btn-dawn { background: linear-gradient(135deg, #7be8e0, #309f9d); color: #062524; box-shadow: 0 4px 14px rgb(48 159 157 / .35); }
.btn-dawn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgb(48 159 157 / .5); }
.menu-btn { display: none; background: transparent; border: 0; color: #fff; padding: 8px; cursor: pointer; border-radius: 10px; }
.menu-btn svg { width: 26px; height: 26px; }

@media (max-width: 960px) {
  .nav {
    position: fixed; inset: var(--header-h) 0 auto; flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: rgb(16 59 58 / .97); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s var(--ease);
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 12px 8px; border-radius: 10px; font-size: 1.05rem; }
  .menu-btn { display: inline-flex; }
  .header-actions { margin-inline-start: auto; }
  .header-actions .btn { display: none; }
}
@media (max-width: 400px) {
  .site-header .container { gap: 10px; }
  .brand { gap: 8px; font-size: 1rem; }
  .brand img { width: 34px; height: 34px; }
  .header-actions { gap: 4px; }
  .lang-switch a { padding: 2px 7px; }
  .menu-btn { padding: 6px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--on-dark);
  padding: calc(var(--header-h) + clamp(32px, 6vw, 72px)) 0 clamp(56px, 8vw, 110px);
  background:
    radial-gradient(1200px 500px at 50% 112%, rgb(242 195 154 / .55), transparent 60%),
    radial-gradient(700px 300px at 15% 100%, rgb(27 98 128 / .45), transparent 70%),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 45%, var(--night-2) 78%, #3c5b73 100%);
}
.stars, .stars::before, .stars::after {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 14%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 38%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 35% 9%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 26%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 77% 33%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 91% 8%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 52%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 4% 56%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 56% 47%, #fff 50%, transparent 51%);
}
.stars { opacity: .7; animation: twinkle 6s ease-in-out infinite; }
.stars::before { content: ""; transform: translate(4%, 7%) scale(1.1); opacity: .6; animation: twinkle 9s ease-in-out infinite reverse; }
.stars::after { content: ""; transform: translate(-6%, 3%) scale(.9); opacity: .5; animation: twinkle 12s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: .95; } }

.crescent {
  position: absolute; width: 110px; height: 110px; top: calc(var(--header-h) + 28px); inset-inline-end: 7%;
  border-radius: 50%; box-shadow: -22px 10px 0 0 #fbe8c8; transform: rotate(-20deg);
  filter: drop-shadow(0 0 24px rgb(251 232 200 / .45)); opacity: .9;
}
html[dir="rtl"] .crescent { inset-inline-end: auto; inset-inline-start: 7%; }

.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(24px, 5vw, 64px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--dawn); font-weight: 700; font-size: .95rem; margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.hero h1 { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.2rem); font-weight: 800; line-height: 1.12; margin-bottom: 18px; }
.hero h1 .accent { background: linear-gradient(90deg, #c4fbf6, #44e1d9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--on-dark-2); max-width: 36em; margin-bottom: 28px; }

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 12px; min-width: 190px; padding: 10px 20px;
  border-radius: 14px; background: #000; color: #fff; text-decoration: none; border: 1px solid rgb(255 255 255 / .22);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.store:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(0 0 0 / .35); }
.store svg { width: 28px; height: 28px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store small { font-size: .72rem; opacity: .85; }
.store b { white-space: nowrap; font-size: 1.15rem; font-weight: 700; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }

.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--on-dark-2); font-size: .95rem; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust svg { width: 18px; height: 18px; color: #9fe0b0; flex: none; }

/* Phone mock-up */
.phone-wrap { position: relative; justify-self: center; width: min(320px, 80vw); }
.phone {
  position: relative; border-radius: 48px; padding: 10px; background: #070b12;
  box-shadow: 0 0 0 2px #2a3442, var(--shadow-3);
}
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; translate: -50% 0; width: 32%; height: 24px; border-radius: 20px; background: #070b12; z-index: 2; }
.phone img { border-radius: 38px; aspect-ratio: 430 / 932; object-fit: cover; width: 100%; background: #1a6b6a; }
.phone.sm { border-radius: 38px; padding: 8px; }
.phone.sm::before { top: 15px; height: 18px; }
.phone.sm img { border-radius: 30px; }

.chip {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 16px; background: rgb(255 255 255 / .94); color: #0f2423;
  box-shadow: 0 12px 30px rgb(0 0 0 / .28); font-size: .88rem; line-height: 1.35;
  animation: float 8s ease-in-out infinite;
}
.chip b { display: block; font-size: 1rem; }
.chip .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--green); color: #fff; }
.chip .ico svg { width: 20px; height: 20px; }
.chip-notif { top: 14%; inset-inline-start: -28%; max-width: 250px; }
.chip-notif .ico { background: none; }
.chip-notif .ico img { width: 36px; height: 36px; border-radius: 10px; }
.chip-qibla { bottom: 18%; inset-inline-end: -22%; animation-delay: -3s; animation-duration: 9s; }
.chip-qibla .ico { background: #1a6b6a; }
.chip-next { bottom: 4%; inset-inline-start: -18%; animation-delay: -5s; animation-duration: 7.5s; }
.chip-next .ico { background: var(--red); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; text-align: start; }
  .phone-wrap { margin-top: 24px; width: min(270px, 70vw); }
  .chip-notif { inset-inline-start: -20%; top: 8%; }
  .chip-qibla { inset-inline-end: -16%; }
  .chip-next { inset-inline-start: -14%; }
  .crescent { display: none; }
}
@media (max-width: 420px) {
  /* Badges share a row when they fit; when they wrap onto two lines they stay badge-sized. */
  .store { min-width: 0; flex: 1 1 150px; max-width: 230px; padding: 10px 14px; justify-content: center; }
  .download .store { flex-basis: 220px; }
  .chip { font-size: .78rem; padding: 8px 10px; }
  .chip .ico { width: 30px; height: 30px; }
  .chip-notif { max-width: 200px; }
}

/* ---------- Stats ---------- */
.stats {
  position: relative; z-index: 2; margin-top: -48px;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
}
.stat { padding: 22px 12px; text-align: center; }
.stat + .stat { border-inline-start: 1px solid var(--border); }
.stat b { display: block; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-weight: 800; color: var(--teal); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-3); font-size: .92rem; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .stat:last-child { grid-column: 1 / -1; }
}

/* ---------- Sections ---------- */
section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: linear-gradient(180deg, var(--night-1), var(--night-2)); color: var(--on-dark); position: relative; overflow: hidden; }
.section-dark .muted, .section-dark .feat p { color: var(--on-dark-2); }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { color: var(--teal); }
.section-dark .section-head .eyebrow { color: var(--dawn); }
.muted { color: var(--ink-2); }

.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(32px, 6vw, 80px); }
.split.flip > :first-child { order: 2; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split.flip > :first-child { order: 0; } }
.media { display: flex; justify-content: center; gap: 18px; }
.media .phone-wrap { width: min(280px, 72vw); }
.media.pair .phone-wrap { width: min(240px, 42vw); }
.media.pair .phone-wrap:nth-child(2) { margin-top: 48px; }

.feats { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 18px; }
.feat { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.feat .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); }
.section-dark .feat .ico { background: rgb(255 255 255 / .08); color: var(--dawn); }
.feat .ico svg { width: 22px; height: 22px; }
.feat h3 { font-size: 1.05rem; margin: 2px 0 2px; }
.feat p { margin: 0; color: var(--ink-2); font-size: .97rem; }

/* Cards grid */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 24px;
  box-shadow: var(--shadow-1); transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); margin-bottom: 14px; }
.card .ico svg { width: 22px; height: 22px; }
.card p { color: var(--ink-2); margin: 0; font-size: .97rem; }
.card.wide { grid-column: span 2; }
@media (max-width: 600px) { .card.wide { grid-column: auto; } }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pill { padding: 3px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .85rem; color: var(--ink-2); }
.pill.on { background: var(--green-soft); color: var(--green); border-color: transparent; font-weight: 700; }

/* Books */
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
@media (max-width: 600px) { .books { grid-template-columns: 1fr; } }
.book { background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); border-radius: var(--r-sm); padding: 14px 16px; }
.book b { display: block; color: #fff; }
.book span { color: var(--on-dark-2); font-size: .88rem; }

/* Themes gallery */
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 2.4vw, 28px); align-items: start; }
.themes figure { margin: 0; text-align: center; }
.themes figure:nth-child(even) { margin-top: 40px; }
.themes figcaption { margin-top: 12px; font-weight: 700; color: var(--ink-2); font-size: .95rem; }
@media (max-width: 760px) {
  .themes { grid-template-columns: repeat(4, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
  .themes::-webkit-scrollbar { display: none; }
  .themes figure { scroll-snap-align: center; }
  .themes figure:nth-child(even) { margin-top: 0; }
}

.themes.three { grid-template-columns: repeat(3, 1fr); max-width: 880px; margin-inline: auto; }
.platform { text-align: center; font-size: 1rem; font-weight: 700; color: var(--teal); letter-spacing: .02em; margin: 36px 0 16px; }
.platform:first-of-type { margin-top: 8px; }
.wshots { align-items: start; }
.wshots figure:nth-child(even) { margin-top: 0; }
.wshot { width: 100%; border-radius: 22px; box-shadow: var(--shadow-2); background: #0b0f17; }
.feats.two { grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 5vw, 56px); max-width: 980px; margin-inline: auto; }
@media (max-width: 760px) {
  .themes.three { grid-template-columns: repeat(3, 62%); max-width: none; }
  .feats.two { grid-template-columns: 1fr; }
}

/* Language tiles */
.langs { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.lang-tile { min-width: 170px; padding: 18px 24px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); text-align: center; box-shadow: var(--shadow-1); }
.lang-tile b { display: block; font-size: 1.5rem; color: var(--teal); }
.lang-tile span { color: var(--ink-3); font-size: .9rem; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-weight: 700; font-size: 1.05rem;
}
.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(--teal-soft); color: var(--teal); font-size: 1.3rem; font-weight: 400; transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); margin: 0 0 18px; }

/* Verse + download */
.verse { text-align: center; padding-bottom: 32px; }
.verse q { quotes: none; display: block; font-size: clamp(1.5rem, 1.1rem + 2vw, 2.4rem); font-weight: 700; color: #f8dcbc; line-height: 1.8; }
.verse cite { display: block; color: var(--on-dark-2); font-style: normal; font-size: .95rem; margin-top: 6px; }
.download {
  display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center;
  padding: clamp(24px, 4vw, 40px); border-radius: var(--r-lg); background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12);
}
.download .app-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 24px rgb(0 0 0 / .35); }
.download h2 { margin-bottom: 6px; }
.download p { color: var(--on-dark-2); margin-bottom: 18px; }
@media (max-width: 760px) { .download { grid-template-columns: 1fr; text-align: center; justify-items: center; } .download .stores { justify-content: center; } }

/* ---------- Live widget demo (Widgets section) ---------- */
.wdemo { --ws:#fff; --wt:#1C1B1F; --wsub:rgba(28,27,31,.58); --wacc:#1B6280; --whl:#E1F0F4; --wband:#1B3A5C; --wr:22px;
  --wf:-apple-system, "SF Pro Text", "SF Arabic", system-ui, sans-serif; max-width: 980px; margin-inline: auto; }
.wdemo[data-mode="dark"] { --ws:#1F1F1F; --wt:#E6E1E5; --wsub:rgba(230,225,229,.6); --wacc:#8ED0E0; --whl:#174A5E; }
.wdemo[data-platform="android"] { --wr:28px; --wf:Roboto, "Noto Sans Arabic", "Google Sans", system-ui, sans-serif; }
.wdemo[data-platform="android"] .only-ios, .wdemo[data-platform="ios"] .only-android { display: none !important; }
.wg-pair > * { min-width: 0; }
.wg-pair .w-small { width: 100%; }

.wdemo-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 22px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.seg button { border: 0; background: transparent; padding: 8px 20px; border-radius: 999px; font: inherit; font-weight: 700; font-size: .95rem; color: var(--ink-2); cursor: pointer; transition: background-color .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--teal); color: #fff; }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed="true"] { color: #0a1716; } }

.wdemo-stage { position: relative; border-radius: var(--r-lg); padding: clamp(18px, 4.5vw, 52px) clamp(14px, 4vw, 48px) 18px;
  background: radial-gradient(90% 70% at 100% 100%, rgba(242,195,154,.55), transparent 60%), linear-gradient(140deg, #d7e9ef 0%, #edf3f5 50%, #f4e6d6 100%);
  box-shadow: var(--shadow-2); transition: background .4s; }
.wdemo[data-mode="dark"] .wdemo-stage { background: radial-gradient(90% 70% at 100% 100%, rgba(242,195,154,.28), transparent 60%), linear-gradient(140deg, #0b1a2e 0%, #13304e 55%, #2f4d65 100%); }
.wdemo-note { text-align: center; font-size: .82rem; color: #566f6e; margin: 18px 0 0; }
.wdemo[data-mode="dark"] .wdemo-note { color: #b4d3d1; }

.wgrid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-areas: "large medium" "large pair" "slim slim";
  gap: clamp(14px, 2vw, 22px); align-items: start; max-width: 860px; margin-inline: auto; }
.wgrid > * { min-width: 0; }
.wg-large { grid-area: large; } .wg-medium { grid-area: medium; } .wg-pair { grid-area: pair; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 22px); } .wg-slim { grid-area: slim; }
@media (max-width: 700px) {
  .wgrid { grid-template-columns: 1fr; grid-template-areas: "medium" "pair" "large" "slim"; }
  .w { padding: 12px 13px; }
  .w-next { gap: 4px; }
  .w-next .w-acc { font-size: .95rem; }
  .w-next b, .w-next .w-count { font-size: .86rem; }
  .w-sub { font-size: .7rem; }
  .w-row { padding: 7px 8px; font-size: .9rem; }
}

.w { background: var(--ws); color: var(--wt); border-radius: var(--wr); padding: 14px 16px; font-family: var(--wf); line-height: 1.3;
  box-shadow: 0 10px 28px rgba(16,32,48,.13), 0 1px 2px rgba(16,32,48,.08); transition: background-color .4s, color .4s, border-radius .3s; }
.w b { font-weight: 700; }
.w-sub { color: var(--wsub); font-size: .74rem; }
.w-acc { color: var(--wacc); }
.w-place { color: var(--wacc); font-size: .78rem; font-weight: 700; display: block; }
.w-count { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.w-small { aspect-ratio: 1; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.w-small .w-sub { margin-top: 4px; }
.w-big { font-size: clamp(1.4rem, 3.2vw, 1.75rem); line-height: 1.15; }
.w-time { font-size: 1.12rem; }
.w-in { font-size: .9rem; margin-top: 2px; }
.w-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.w-top > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-next { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; white-space: nowrap; min-width: 0; }
.w-next > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.w-next .w-count, .w-next b { flex: none; }
.w-next .w-acc { font-size: 1.05rem; }
.w-gap { flex: 1; }
.w-cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 12px; }
.w-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; font-size: clamp(.62rem, 2.4vw, .82rem); white-space: nowrap; min-width: 0; transition: background-color .4s; }
.w-cell.is-next, .w-row.is-next { background: var(--whl); }
.w-band { background: var(--wband); color: #fff; border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; font-size: .8rem; }
.w-band b { font-size: .98rem; }
.w-large .w-next { padding: 0 4px; }
.w-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.w-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: .95rem; transition: background-color .4s; }
.w-row.w-quiet { color: var(--wsub); font-size: .82rem; padding-block: 5px; }

.w-lock { aspect-ratio: 1; border-radius: 22px; padding: 14px; color: #fff; display: flex; flex-direction: column; align-items: center; font-family: var(--wf);
  background: radial-gradient(80% 60% at 20% 90%, rgba(242,195,154,.65), transparent 65%), linear-gradient(160deg, #3c2f5c 0%, #5b4a7e 45%, #2a2046 100%);
  box-shadow: 0 10px 28px rgba(16,32,48,.2); }
.w-lock-date { font-size: .72rem; opacity: .9; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-lock-clock { font-size: clamp(2.2rem, 5vw, 2.9rem); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; direction: ltr; }
.w-lock-widget { align-self: stretch; display: flex; flex-direction: column; margin-top: 6px; font-size: .74rem; line-height: 1.35; }
.w-lock-widget b { font-size: .9rem; }
.w-lock-widget span:first-child { opacity: .8; }

.w-apps { aspect-ratio: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14%; padding: 10%; align-items: center; justify-items: center; }
.w-apps i { width: 100%; aspect-ratio: 1; border-radius: 28%; background: rgba(255,255,255,.55); }
.wdemo[data-mode="dark"] .w-apps i { background: rgba(255,255,255,.12); }
.w-apps img { width: 100%; height: auto; border-radius: 28%; grid-row: 2; grid-column: 2; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.w-apps small { grid-column: 2; font-size: .68rem; margin-top: -10%; color: #0f2423; text-align: center; white-space: nowrap; }
.wdemo[data-mode="dark"] .w-apps small { color: #e6f3f2; }
.w-slim { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; }
.w-slim > div { display: flex; flex-direction: column; }

.wchips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 0; padding: 0; }
.wchips li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); font-size: .92rem; }
.wchips svg { width: 18px; height: 18px; color: var(--teal); flex: none; }

/* ---------- Qibla compass demo (Qibla section) ---------- */
.qdemo { margin-top: clamp(40px, 6vw, 72px); border-radius: var(--r-lg); padding: clamp(20px, 4vw, 44px);
  background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .12); }
.qdemo-head { text-align: center; }
.qdemo-head h3 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.7rem); color: #fff; margin-bottom: 4px; }
.qdemo-head p { color: var(--on-dark-2); margin: 0 auto 16px; max-width: 34em; }
.qseg { background: rgb(255 255 255 / .06); border-color: rgb(255 255 255 / .14); box-shadow: none; flex-wrap: wrap; justify-content: center; }
.qseg button { color: var(--on-dark-2); padding: 7px 14px; }
.qseg button[aria-pressed="true"] { background: var(--dawn); color: #2a1a0c; }
.qdemo-body { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: center; margin-top: 26px; }
@media (max-width: 760px) { .qdemo-body { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

.qdial { width: min(340px, 82vw); height: auto; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; overflow: visible; }
.qdial:active { cursor: grabbing; }
.qdial:focus { outline: none; }
.qdial:focus-visible { outline: 1.5px dashed rgb(255 255 255 / .55); outline-offset: 10px; border-radius: 50%; }
.q-ring { fill: rgb(255 255 255 / .04); stroke: rgb(255 255 255 / .28); stroke-width: 1.2; transition: stroke .3s, fill .3s; }
.q-tick { stroke: rgb(255 255 255 / .35); stroke-width: .8; }
.q-tick-l { stroke: rgb(255 255 255 / .75); stroke-width: 1.6; }
.q-card { fill: rgb(255 255 255 / .8); font: 700 11px var(--font); text-anchor: middle; dominant-baseline: middle; }
.q-north { fill: var(--dawn); }
.q-kaaba { fill: #111; stroke: rgb(255 255 255 / .55); stroke-width: .8; }
.q-kaaba-band { fill: #d8b25e; }
.q-arc { fill: none; stroke: var(--dawn); stroke-width: 5; stroke-linecap: round; opacity: .9; transition: stroke .3s; }
.q-marker { fill: var(--dawn); transition: fill .3s; }
.q-hub { fill: rgb(255 255 255 / .08); stroke: rgb(255 255 255 / .18); transition: fill .3s; }
.q-num { fill: #fff; font: 800 20px var(--font); text-anchor: middle; font-variant-numeric: tabular-nums; }
.q-numlab { fill: var(--on-dark-2); font: 500 7.5px var(--font); text-anchor: middle; }
.qdemo.is-aligned .q-ring { stroke: #81c784; fill: rgb(129 199 132 / .1); }
.qdemo.is-aligned .q-marker { fill: #81c784; }
.qdemo.is-aligned .q-hub { fill: rgb(129 199 132 / .3); }
.qdemo.is-aligned .q-hint { color: #9fe0b0; }

.q-hint { font-size: clamp(1.15rem, 1rem + .8vw, 1.45rem); font-weight: 800; color: #fff; min-height: 2.6em; margin: 0 0 14px; }
.q-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.q-facts div { background: rgb(255 255 255 / .06); border-radius: var(--r-sm); padding: 10px 14px; }
.q-facts dt { color: var(--on-dark-2); font-size: .85rem; }
.q-facts dd { margin: 0; color: #fff; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.q-facts dd[data-q="km"] { direction: inherit; unicode-bidi: normal; }
.q-note { color: var(--on-dark-2); font-size: .85rem; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night-0); color: var(--on-dark-2); padding: 56px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--on-dark-2); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .brand { margin-bottom: 12px; }
.footer-bottom { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / .1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .88rem; }

/* ---------- Legal pages ---------- */
.legal-hero { background: linear-gradient(180deg, var(--night-1), var(--night-2)); color: var(--on-dark); padding: calc(var(--header-h) + 48px) 0 48px; }
.legal-hero h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); font-weight: 800; margin-bottom: 8px; }
.legal-hero p { color: var(--on-dark-2); margin: 0; }
.legal-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 48px; padding: 48px 0 80px; align-items: start; }
@media (max-width: 900px) { .legal-wrap { grid-template-columns: 1fr; gap: 24px; } }
.toc { position: sticky; top: calc(var(--header-h) + 20px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; font-size: .92rem; }
@media (max-width: 900px) { .toc { position: static; } }
.toc b { display: block; margin-bottom: 8px; }
.toc ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 4px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--teal); text-decoration: underline; }
.legal-wrap > * { min-width: 0; }
.legal { max-width: 760px; overflow-wrap: break-word; }
.legal td { overflow-wrap: anywhere; hyphens: auto; }
.legal h2 { font-size: 1.45rem; margin: 40px 0 12px; scroll-margin-top: calc(var(--header-h) + 16px); }
.legal h2 .n { color: var(--teal); font-variant-numeric: tabular-nums; margin-inline-end: 10px; }
.legal h3 { font-size: 1.1rem; margin: 22px 0 8px; }
.legal p, .legal li { color: var(--ink-2); }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: 6px; }
.glance { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 600px) { .glance { grid-template-columns: 1fr; } }
.glance div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; }
.glance b { display: block; color: var(--ink); margin-bottom: 2px; }
.glance span { color: var(--ink-2); font-size: .95rem; }
.table-wrap { overflow-x: auto; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 8px 0 16px; }
.legal th, .legal td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--ink-2); }
.legal th { color: var(--ink); background: var(--surface-2); }
.note { background: var(--teal-soft); border-radius: var(--r-sm); padding: 14px 18px; color: var(--ink); }

/* Support page */
.contact-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; box-shadow: var(--shadow-1); }
.contact-card .btn { background: var(--teal); color: #fff; }
@media (prefers-color-scheme: dark) { .contact-card .btn { color: #0a1716; } }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: calc(var(--header-h) + 40px) var(--gutter) 60px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

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