/* Thaqib's own page. The app's type (SF Pro Rounded, heavy titles), its
   colours (Palette.swift / Assets Tokens): the hero's indigo night, the gold
   star, the "Spend my stars" button, the kids' colours and the prayer skies.
   Moving parts stop with Reduce Motion. */

:root {
  --night-top: #1A1450;
  --indigo-top: #241C66;
  --indigo-bottom: #33279A;
  --glow: #5A47E0;
  --accent: #6C5CE7;
  --lavender: #A99BFF;
  --gold: #FFC83D;
  --gold-light: #FFE7A3;
  --gold-stroke: #FFF3CC;
  --spend-top: #FFD15C;
  --spend-bottom: #FFAE2B;
  --spend-text: #4A2A00;
  --ink: #1E1747;
  --ink-2: #6B6590;
  --app-bg: #F4F3F9;
  --text: #F3F1FF;
  --text-2: #CFC9F2;
  --text-3: #A9A3CC;
  --card: #FFFFFF;
  --line: rgba(255, 255, 255, 0.12);
  --round: ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --arabic: "SF Arabic Rounded", "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", Tahoma, sans-serif;
  --maxw: 1160px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--text); font-family: var(--round); font-size: 17px; line-height: 1.6;
  background: linear-gradient(180deg, var(--night-top) 0%, var(--indigo-top) 30%, var(--indigo-bottom) 100%) fixed;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
[lang="ar"] { font-family: var(--arabic); }
[id] { scroll-margin-top: 80px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
.wrap { position: relative; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- The coloured night behind everything ---------- */
.glows { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.glows i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; }
.glows i:nth-child(1) { width: 52vmax; height: 52vmax; left: 30%; top: -18vmax; background: var(--glow); opacity: 0.6; }
.glows i:nth-child(2) { width: 34vmax; height: 34vmax; left: -10vmax; top: 30%; background: #FF8CC6; opacity: 0.22; }
.glows i:nth-child(3) { width: 30vmax; height: 30vmax; right: -8vmax; top: 48%; background: #6EE7B7; opacity: 0.16; }
.glows i:nth-child(4) { width: 28vmax; height: 28vmax; left: 38%; bottom: -14vmax; background: var(--gold); opacity: 0.16; }
@media (prefers-reduced-motion: no-preference) {
  .glows i { animation: drift 26s ease-in-out infinite alternate; }
  .glows i:nth-child(2) { animation-duration: 31s; animation-delay: -6s; }
  .glows i:nth-child(3) { animation-duration: 23s; animation-delay: -11s; }
  .glows i:nth-child(4) { animation-duration: 35s; animation-delay: -3s; }
  @keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(6vw, 4vh) scale(1.12); } }
}
.sky { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
main, .nav, footer { position: relative; z-index: 2; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(26, 20, 80, 0.6); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(150%) blur(16px); backdrop-filter: saturate(150%) blur(16px); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand b { font-weight: 800; font-size: 1.35rem; }
.brand span { font-family: var(--arabic); font-weight: 700; font-size: 1.15rem; color: var(--text-2); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { text-decoration: none; color: var(--text-2); font-weight: 700; font-size: 0.95rem; }
.nav-links a:hover { color: #fff; }
/* The other language stays in the bar on phones, beside Download. */
.nav-links .nav-lang { padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
@media (max-width: 820px) { .nav-links a:not(.gold-button):not(.nav-lang) { display: none; } .nav-links .nav-lang { padding-inline-start: 0; border-inline-start: 0; } }

/* "Spend my stars": gold, top to bottom, dark brown words. */
.gold-button { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800;
  color: var(--spend-text) !important; padding: 9px 18px; border-radius: 999px;
  background: linear-gradient(180deg, var(--spend-top), var(--spend-bottom));
  box-shadow: 0 3px 0 #D9851B, 0 8px 20px rgba(255, 174, 43, 0.35); transition: transform .15s ease, box-shadow .15s ease; }
.gold-button:hover { transform: translateY(-2px); box-shadow: 0 5px 0 #D9851B, 0 12px 26px rgba(255, 174, 43, 0.45); }
.gold-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #D9851B, 0 4px 10px rgba(255, 174, 43, 0.3); }
.gold-button svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 32px; align-items: center; padding: 56px 24px 48px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.85rem;
  color: var(--text-2); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
h1 { font-size: clamp(2.8rem, 6.6vw, 5rem); line-height: 1.0; font-weight: 800; letter-spacing: -0.02em; margin: 20px 0 20px; }
.goldtext { background: linear-gradient(180deg, #FFF1B0 0%, var(--gold) 55%, #FF9A2B 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 1.2rem; color: var(--text-2); max-width: 30em; margin: 0 0 28px; }
.cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.appstore img { height: 54px; width: auto; filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35)); transition: transform .2s; }
.appstore:hover img { transform: translateY(-2px) rotate(-1deg); }
.note { font-weight: 700; color: var(--text-2); font-size: 0.95rem; }

/* The icon's star and bubbles, floating (IconArt). */
.art { position: relative; width: min(100%, 470px); aspect-ratio: 1; margin: 0 auto; }
.art::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle, rgba(90, 71, 224, 0.95), rgba(90, 71, 224, 0) 70%); }
/* Each layer group fills the square (a transform makes it the images' container). */
.art .orbs, .art .star { position: absolute; inset: 0; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .art .orbs { animation: bob 7s ease-in-out infinite; }
  .art .star { animation: bob 7s ease-in-out infinite; animation-delay: -2.2s; }
  .art::before { animation: breathe 5s ease-in-out infinite; }
  @keyframes bob { 50% { transform: translateY(-12px); } }
  @keyframes breathe { 50% { opacity: 0.7; transform: scale(1.06); } }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 32px; }
  .hero .art { order: -1; width: min(72%, 320px); }
  .lede { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
}

/* ---------- Section heads ---------- */
section { padding: 72px 0; }
.head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.kicker { display: inline-block; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 14px; }
.head p { color: var(--text-2); font-size: 1.1rem; margin: 0; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.15fr; gap: 18px; align-items: stretch; }
@media (max-width: 1020px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } .steps .star-card { grid-column: 1 / -1; } }
@media (max-width: 680px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--card); color: var(--ink); border-radius: 28px; padding: 26px 24px; box-shadow: 0 18px 40px rgba(16, 10, 60, 0.35);
  transition: transform .25s ease; }
.step:hover { transform: translateY(-6px) rotate(-1deg); }
.step:nth-child(2):hover { transform: translateY(-6px) rotate(1deg); }
.step .num { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; margin-bottom: 16px; }
.step:nth-child(1) .num { background: #E0E4FF; color: #3B4BB8; }
.step:nth-child(2) .num { background: #DFF6EC; color: #17996A; }
.step:nth-child(3) .num { background: #FFF0C8; color: #8A4B00; }
.step h3 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.step p { margin: 0; color: var(--ink-2); font-size: 1rem; }

/* The hero card's next star (StarProgress, on the night). */
.star-card { border-radius: 28px; padding: 22px; display: flex; align-items: center; gap: 20px;
  background: linear-gradient(160deg, var(--indigo-top), var(--indigo-bottom)); box-shadow: 0 18px 40px rgba(16, 10, 60, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative; overflow: hidden; }
.star-card::before { content: ""; position: absolute; width: 260px; height: 260px; inset-inline-start: -40px; top: -40px; border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 71, 224, 0.9), rgba(90, 71, 224, 0) 70%); }
.star-card svg { position: relative; width: 150px; height: 150px; flex: none; overflow: visible; }
.star-card .words { position: relative; min-width: 0; }
/* Four across, the card is too narrow for the star beside its words: the star goes on top. */
@media (min-width: 1021px) {
  .star-card { flex-direction: column; justify-content: center; text-align: center; gap: 14px; }
  .star-card svg { width: 128px; height: 128px; }
}
.star-card small { display: block; font-weight: 700; color: var(--text-2); font-size: 0.85rem; }
.star-card strong { display: block; font-weight: 800; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.star-card .words span { display: block; color: var(--text-2); font-weight: 600; font-size: 0.95rem; margin-top: 4px; }
.star-body { fill: rgba(255, 255, 255, 0.1); }
.star-dash { stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.6; stroke-dasharray: 2.2 3.2; stroke-linecap: round; }
.star-line { stroke: var(--gold); stroke-width: 4.5; stroke-linecap: round; transition: stroke-dashoffset .3s ease-out; }
.star-line.on { stroke-dashoffset: 0; }
.star-dot { fill: rgba(255, 255, 255, 0.4); transform: scale(0.6); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), fill .2s; }
.star-dot.on { fill: var(--gold); stroke: var(--gold-stroke); stroke-width: 1.5; transform: scale(1); }
.star-ring { fill: none; stroke: var(--gold-light); stroke-width: 1.1; stroke-dasharray: 2 1.6; opacity: 0; transition: opacity .2s; }
.star-ring.on { opacity: 1; }
.star-gold { stroke: var(--gold); stroke-width: 6.3; stroke-linejoin: round; opacity: 0; transform: scale(0.85); transform-origin: 50% 55%;
  transition: opacity .3s, transform .45s cubic-bezier(.34, 1.56, .64, 1); filter: drop-shadow(0 0 10px rgba(255, 200, 61, 0.55)); }
.full .star-gold { opacity: 1; transform: scale(1); }
.full .star-dot, .full .star-line, .full .star-dash { opacity: 0; transition: opacity .2s; }

/* ---------- Feature rows ---------- */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; padding: 40px 0; }
.row--rev .copy { order: 2; }
.row h2 { text-align: start; }
.row .copy > p { color: var(--text-2); font-size: 1.1rem; margin: 0 0 20px; max-width: 30em; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; }
.ticks svg { flex: none; width: 22px; height: 22px; margin-top: 2px; fill: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 200, 61, 0.5)); }
@media (max-width: 860px) {
  .row { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .row--rev .copy { order: 0; }
  .row h2 { text-align: center; }
  .row .copy > p { margin-left: auto; margin-right: auto; }
  .ticks { max-width: 26em; margin: 0 auto; text-align: start; }
}

.phone { position: relative; width: 100%; max-width: 290px; margin: 0 auto; padding: 9px; border-radius: 46px;
  background: linear-gradient(155deg, #3A3270 0%, #120E33 100%);
  box-shadow: 0 40px 80px rgba(10, 6, 40, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.phone img { border-radius: 38px; }
.phone-wrap { position: relative; }
.phone-wrap::before { content: ""; position: absolute; inset: 6% -6%; border-radius: 50%; filter: blur(50px);
  background: radial-gradient(circle, rgba(90, 71, 224, 0.75), transparent 70%); }
.pair { display: grid; place-items: center; }
.pair .phone { grid-area: 1 / 1; width: min(64%, 250px); padding: 7px; border-radius: 36px; }
.pair .phone img { border-radius: 29px; }
.pair .back { transform: translate(30%, -6%) rotate(5deg) scale(0.9); }
.pair .front { transform: translate(-24%, 8%) rotate(-4deg); z-index: 2; }

/* The deeds' categories, in the app's tile colours. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.chips li { padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 0.92rem; }
@media (max-width: 860px) { .chips { justify-content: center; } }

/* ---------- The five prayers, each in its sky ---------- */
.prayers { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .prayers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 420px) { .prayers { grid-template-columns: repeat(2, minmax(0, 1fr)); } .prayer:last-child { grid-column: 1 / -1; } }
.prayer { border-radius: 24px; padding: 20px 14px 18px; text-align: center; color: #fff; box-shadow: 0 14px 30px rgba(10, 6, 40, 0.35);
  transition: transform .25s ease; }
.prayer:hover { transform: translateY(-6px) scale(1.03); }
.prayer svg { width: 54px; height: 44px; fill: #fff; margin: 0 auto 10px; display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18)); }
.prayer b { display: block; font-weight: 800; font-size: 1.15rem; }
.prayer span { display: block; font-family: var(--arabic); font-weight: 700; opacity: 0.9; }

/* ---------- Family ---------- */
.family { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .family { grid-template-columns: 1fr; text-align: center; } }
.counts { display: flex; gap: 28px; flex-wrap: wrap; margin: 22px 0; }
@media (max-width: 860px) { .counts { justify-content: center; } }
.count b { display: block; font-size: 3.4rem; font-weight: 800; line-height: 1; }
.count span { font-weight: 700; color: var(--text-2); }
.bubbles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
@media (max-width: 860px) { .bubbles { justify-content: center; } }
.bubbles li { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
  box-shadow: 0 6px 14px rgba(10, 6, 40, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.12); }
@media (prefers-reduced-motion: no-preference) {
  .bubbles li { animation: hop 3.2s ease-in-out infinite; }
  .bubbles li:nth-child(2n) { animation-delay: -0.8s; } .bubbles li:nth-child(3n) { animation-delay: -1.6s; } .bubbles li:nth-child(5n) { animation-delay: -2.4s; }
  @keyframes hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-8px); } }
}
.ipad { max-width: 460px; margin: 0 auto; padding: 12px; border-radius: 36px; background: linear-gradient(155deg, #3A3270 0%, #120E33 100%);
  box-shadow: 0 40px 80px rgba(10, 6, 40, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.ipad img { border-radius: 26px; }

/* ---------- Cards on the night ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 24px; padding: 22px; }
.card svg { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 12px; }
.card b { display: block; font-weight: 800; font-size: 1.12rem; margin-bottom: 4px; }
.card p { margin: 0; color: var(--text-2); font-size: 0.98rem; }

.plan { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 28px; align-items: center; background: var(--card); color: var(--ink);
  border-radius: 32px; padding: 36px; box-shadow: 0 24px 60px rgba(10, 6, 40, 0.45); }
@media (max-width: 820px) { .plan { grid-template-columns: 1fr; text-align: center; padding: 30px 22px; } .plan .badge-star { width: 140px; order: -1; } }
.plan h2 { color: var(--ink); text-align: start; margin-top: 6px; }
@media (max-width: 820px) { .plan h2 { text-align: center; } }
.plan p { color: var(--ink-2); margin: 0 0 12px; }
.plan .kicker { color: var(--accent); }
.plan a { color: var(--accent); font-weight: 800; }
.plan .badge-star { width: min(100%, 220px); margin: 0 auto; }

/* ---------- The end: the welcome's star ---------- */
.final { text-align: center; padding: 96px 0 110px; }
.welcome-star { position: relative; width: 150px; height: 150px; margin: 0 auto 28px; }
.welcome-star::before { content: ""; position: absolute; inset: -60%; border-radius: 50%; background: radial-gradient(circle, rgba(90, 71, 224, 0.9), rgba(90, 71, 224, 0) 62%); }
.welcome-star svg { position: relative; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 16px rgba(255, 200, 61, 0.5)); }
.welcome-star i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.62); }
.welcome-star i:nth-of-type(1) { width: 13%; height: 13%; left: -12%; top: 48%; }
.welcome-star i:nth-of-type(2) { width: 10%; height: 10%; left: -30%; top: 70%; }
@media (prefers-reduced-motion: no-preference) {
  .welcome-star { animation: bob 7s ease-in-out infinite; }
  .welcome-star::before { animation: breathe 5s ease-in-out infinite; }
}
.final p { color: var(--text-2); font-size: 1.12rem; max-width: 30em; margin: 0 auto 28px; }

/* ---------- Rise in ---------- */
.rise { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.rise.in { opacity: 1; transform: none; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); background: rgba(16, 12, 52, 0.5); }
.foot { max-width: var(--maxw); margin: 0 auto; padding: 28px 24px 36px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--text-3); font-size: 0.95rem; }
.foot a { color: var(--text-2); text-decoration: none; font-weight: 700; }
.foot a:hover { color: #fff; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot .who { display: flex; align-items: center; gap: 10px; }
.foot .who img { width: 28px; height: 28px; }

/* ---------- Arabic (/ar/thaqib/), right to left ---------- */
/* SF Arabic (Rounded where the system has it) on Apple devices. Arabic letters join, so no
   letter-spacing or capitals, and they need more line height than the Latin headings. */
:root[lang="ar"] { --round: ui-rounded, "SF Arabic Rounded", "SF Arabic", system-ui, -apple-system, "Segoe UI", "Geeza Pro", "Noto Naskh Arabic", Tahoma, sans-serif; }
:root[lang="ar"] body { line-height: 1.75; }
:root[lang="ar"] :is(h1, h2, .kicker) { letter-spacing: 0; }
:root[lang="ar"] h1 { line-height: 1.25; }
:root[lang="ar"] h2 { line-height: 1.3; }
:root[lang="ar"] .kicker { text-transform: none; font-size: 0.95rem; }
:root[lang="ar"] .brand b { font-size: 1.4rem; }
