/* Night sky of the app logo: one dark ground, cream ink, gold accent, emerald as second brand tone.
   Layout: wide hero with the 3D arch, then alternating text/screen splits around a pinned phone story. */
:root {
  color-scheme: dark;
  --night: #070e1f;
  --night-2: #0b1529;
  --surface: #101c34;
  --line: rgba(242, 232, 213, 0.12);
  --ink: #f2e8d5;
  --muted: #b3bccb;
  --gold: #d9b36a;
  --gold-hi: #f2d79a;
  --emerald: #3fb489;

  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Readex Pro", "Segoe UI", system-ui, sans-serif;
  --quran: "Amiri Quran", "Amiri", "Noto Naskh Arabic", serif;

  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --max: 1240px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

* { 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;
  background: var(--night);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 600; }
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.02; }
h2 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); }
h3 { font-size: 1.35rem; line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }
[dir="rtl"] h1, [dir="rtl"] h2 { font-family: var(--body); letter-spacing: 0; line-height: 1.25; font-weight: 600; }
[dir="rtl"] body { line-height: 1.8; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--gold); color: var(--night); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- Bar ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--night); }
.bar { position: fixed; inset: 0 0 auto; z-index: 20; padding-top: env(safe-area-inset-top, 0px); transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease); border-bottom: 1px solid transparent; }
.bar.is-solid { background: rgba(7, 14, 31, 0.92); border-bottom-color: var(--line); }
.bar__in { max-width: var(--max); margin-inline: auto; display: flex; align-items: center; gap: 28px; height: 68px;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.brand img { border-radius: 8px; }
.bar__nav { display: flex; gap: 26px; margin-inline-start: auto; }
.bar__nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; padding-block: 10px; transition: color 0.2s; }
.bar__nav a:hover { color: var(--ink); }
.langs { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.langs a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: var(--muted); font: 500 0.82rem/1 var(--body); min-width: 40px; height: 34px; border-radius: 999px; }
.langs a[aria-current="true"] { background: var(--ink); color: var(--night); }
.langs a:hover:not([aria-current="true"]) { color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; background: var(--gold); color: var(--night); text-decoration: none; font-weight: 600; padding: 0 22px; height: 48px; transition: background-color 0.2s, transform 0.16s var(--ease); }
.btn:hover { background: var(--gold-hi); }
.btn:active { transform: scale(0.97); }
.btn--small { height: 40px; padding: 0 18px; font-size: 0.9rem; }

@media (max-width: 880px) {
  .bar__nav { display: none; }
  .langs { margin-inline-start: auto; }
  .bar .btn--small { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(100svh, 980px); display: flex; align-items: center; overflow: hidden; padding-block: 120px 80px; }
.hero__stage { position: relative; width: min(880px, 130%); margin-inline: -15%; aspect-ratio: 1; justify-self: center; }
.hero__sky { position: absolute; inset: 0; width: 100%; height: 100%; display: block; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); mask-image: radial-gradient(closest-side, #000 72%, transparent 100%); }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 160px; background: linear-gradient(transparent, var(--night)); pointer-events: none; }
.hero__in { position: relative; width: 100%; max-width: var(--max); margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: center;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.hero__copy { display: grid; gap: 26px; justify-items: start; }
.hero__name { font: 400 clamp(2.2rem, 4.4vw, 3.4rem)/1.9 var(--quran); color: var(--gold); }
.hero h1 { font-size: clamp(3rem, 6vw, 5.4rem); max-width: 13ch; }
[dir="rtl"] .hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.8rem); max-width: 14ch; }
.hero__sub { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--muted); max-width: 46ch; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store { display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 20px 0 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(16, 28, 52, 0.7); }
.store svg { width: 24px; height: 24px; fill: var(--ink); }
.store span { display: grid; line-height: 1.15; }
.store small { font-size: 0.72rem; color: var(--muted); }
.store b { font-size: 1.02rem; font-weight: 600; }
.verse { margin: 8px 0 0; padding-inline-start: 18px; border-inline-start: 1px solid rgba(217, 179, 106, 0.45); display: grid; gap: 6px; max-width: 46ch; }
.verse blockquote { margin: 0; display: grid; gap: 4px; }
.verse__ar { font: 400 1.5rem/1.9 var(--quran); color: var(--ink); }
.verse__tr { color: var(--ink); font-style: italic; }
[dir="rtl"] .verse__tr { display: none; }
.verse figcaption { font-size: 0.85rem; color: var(--muted); }
.shot.hero__phone { position: absolute; width: 29%; left: 35.5%; top: 31%; border-radius: 26px; border-width: 5px; }

@media (max-width: 880px) {
  .hero { padding-block: 104px 40px; }
  .hero__in { grid-template-columns: 1fr; gap: 56px; }
  .shot.hero__phone { border-radius: 18px; border-width: 4px; }
}

/* ---------- Screenshot frame ---------- */
.shot { width: 100%; aspect-ratio: 540 / 1170; object-fit: cover; border-radius: 34px; border: 7px solid #1a2438; background: var(--night-2); }
.shot--small { max-width: 220px; border-radius: 26px; border-width: 5px; }

/* ---------- Sections ---------- */
section { position: relative; }
.story, .gallery, .tasbih, .names, .languages, .privacy, .faq { padding-block: clamp(96px, 14vw, 180px); }
.story__head, .gallery__head { display: grid; gap: 14px; max-width: var(--max); }
.story__head p, .gallery__head p, .split__copy > p { color: var(--muted); max-width: 52ch; font-size: 1.08rem; }

/* Story: pinned phone */
.story__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; margin-top: 40px; }
.story__stage { position: sticky; top: 0; height: 100svh; order: 2; }
.story__stage canvas, .story__fallback { position: absolute; inset: 9svh 0; width: 100%; height: 82svh; }
.story__fallback { object-fit: contain; border: 0; background: none; border-radius: 0; padding: 2svh 18%; }
.story__steps { list-style: none; margin: 0; padding: 0; order: 1; }
.story__steps li { min-height: 88svh; display: flex; flex-direction: column; justify-content: center; gap: 14px; max-width: 30rem; }
.story__steps h3 { font-family: var(--display); font-size: clamp(2rem, 3.4vw, 2.9rem); letter-spacing: -0.015em; line-height: 1.05; color: var(--ink); }
[dir="rtl"] .story__steps h3 { font-family: var(--body); letter-spacing: 0; line-height: 1.35; }
.story__steps p { color: var(--muted); font-size: 1.1rem; }
.story__steps li:not(.is-active) h3 { color: rgba(242, 232, 213, 0.45); }
.story__steps h3 { transition: color 0.3s var(--ease); }
.shot--inline { display: none; }
@media (max-width: 880px) {
  .story__grid { grid-template-columns: 1fr; gap: 0; }
  .story__stage { display: none; }
  .story__steps li { min-height: 0; padding-block: 48px; max-width: none; }
  .shot--inline { display: block; width: min(260px, 66vw); margin-bottom: 20px; }
}

/* Gallery rail */
.gallery__head { grid-template-columns: 1fr auto; align-items: end; }
.gallery__nav { display: flex; gap: 10px; }
.round { width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: background-color 0.2s; }
.round:hover { background: var(--surface); }
.round svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .round svg { transform: scaleX(-1); }
.rail { list-style: none; margin: 48px 0 0; padding: 0 max(20px, calc((100vw - var(--max)) / 2 + 20px)) 12px; display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.rail li { flex: 0 0 auto; width: clamp(200px, 21vw, 250px); scroll-snap-align: start; display: grid; gap: 14px; }
.rail .shot { border-radius: 28px; border-width: 6px; }
.rail p { color: var(--muted); font-size: 0.95rem; }

/* Splits */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.split--flip .split__copy { order: 2; }
.split__copy { display: grid; gap: 20px; align-content: center; }
.split__media { position: relative; min-height: 520px; }
.split__media--plain { min-height: 0; display: grid; place-items: center; }
.split__media--plain .shot { max-width: 300px; }
.stage3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .split--flip .split__copy { order: 0; }
  .split__media { min-height: 420px; }
}

.split__copy > .dhikr { font: 400 2rem/1.8 var(--quran); color: var(--gold); min-height: 1.8em; }
.split__copy > .counter { font: 500 4.2rem/1 var(--body); font-variant-numeric: lining-nums tabular-nums; display: flex; align-items: baseline; gap: 10px; }
.counter__of { font-size: 1.6rem; color: var(--muted); }
.split__copy > .tasbih__done { color: var(--emerald); min-height: 1.6em; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 520px; justify-self: center; }
.pair figure { margin: 0; display: grid; gap: 12px; justify-items: center; }
.pair figcaption { color: var(--muted); }

.points { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 0; }
.points li { padding: 18px 0; border-top: 1px solid var(--line); font-size: 1.08rem; }
.points li:last-child { border-bottom: 1px solid var(--line); }

/* FAQ */
.faq__in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 48px; }
.faq__list details { border-top: 1px solid var(--line); }
.faq__list details:last-child { border-bottom: 1px solid var(--line); }
.faq__list summary { cursor: pointer; list-style: none; padding: 22px 36px 22px 0; position: relative; font-weight: 500; font-size: 1.1rem; }
[dir="rtl"] .faq__list summary { padding: 22px 0 22px 36px; }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after { content: "+"; position: absolute; inset-inline-end: 4px; top: 18px; font-size: 1.5rem; color: var(--gold); transition: transform 0.2s var(--ease); }
.faq__list details[open] summary::after { transform: rotate(45deg); }
.faq__list details p { padding-bottom: 22px; color: var(--muted); max-width: 60ch; }
@media (max-width: 880px) { .faq__in { grid-template-columns: 1fr; } }

/* Final + footer */
.final { padding-block: clamp(96px, 12vw, 160px); background: var(--night-2); border-top: 1px solid var(--line); }
.final__in { display: grid; justify-items: center; text-align: center; gap: 22px; }
.final__icon { border-radius: 28px; }
.final p { color: var(--muted); max-width: 46ch; }
.foot { border-top: 1px solid var(--line); padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.92rem; }
.foot__in { display: grid; gap: 12px; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot a { color: var(--ink); text-underline-offset: 3px; }
.foot__brand { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
