/*
  Mizaniyah website. Colours come from the app's "Emerald & Mint" theme.
  No web fonts are loaded (so visitors are not tracked by a font service):
  titles use the system serif (New York on Apple devices), text uses the system sans.
*/
:root {
  --night: #07342b;
  --emerald: #0f5c4a;
  --ink-blue: #10304a;
  --gold: #d8b46a;
  --gold-deep: #8f7032;
  --mint: #7fd1b5;

  --page: #f8f4ea;
  --paper: #fffdf8;
  --ink: #1e2426;
  --muted: #5c6663;
  --line: #e4dccb;
  --link: #0f5c4a;
  --soft: #eae3d2;

  --serif: ui-serif, 'New York', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --arabic: 'Geeza Pro', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
  --urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Geeza Pro', 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0a1220;
    --paper: #101c2e;
    --ink: #f4efe4;
    --muted: #a8b2bf;
    --line: #22304a;
    --link: #7fd1b5;
    --soft: #16253a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }

/* ---------- Header (shared) ---------- */
.site-header {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 34px; height: 34px; }
.brand span { font: 600 22px/1 var(--serif); letter-spacing: -0.01em; }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav a { color: inherit; opacity: 0.78; text-decoration: none; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current='page'] { opacity: 1; text-decoration: underline; }

/* ---------- Home: the night hero ---------- */
.night {
  position: relative;
  overflow: hidden;
  color: #f4efe4;
  background:
    radial-gradient(70% 60% at 78% 38%, rgba(216, 180, 106, 0.16), transparent 70%),
    linear-gradient(160deg, var(--night) 0%, var(--emerald) 52%, var(--ink-blue) 100%);
}
.night a { color: #f4efe4; }
.night .lattice {
  position: absolute;
  inset: -120px;
  opacity: 0.16;
  background-image: url("lattice.svg");
  background-size: 120px 120px;
  animation: drift 90s linear infinite;
}
@keyframes drift { to { transform: translate(120px, 120px); } }
.hero {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 20px 96px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font: 600 clamp(44px, 7vw, 84px)/1.0 var(--serif);
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  max-width: 12.5ch;
}
.hero p.lead { font-size: 20px; line-height: 1.55; color: rgba(244, 239, 228, 0.86); max-width: 34ch; margin: 0 0 32px; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(216, 180, 106, 0.55);
  color: var(--gold);
  font-size: 15px;
}
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(216, 180, 106, 0.2); }
.hero .languages { margin: 28px 0 0; font-size: 15px; color: rgba(244, 239, 228, 0.7); }
.hero .languages span { color: #f4efe4; margin-right: 14px; }
.hero .languages .ur { font-family: var(--urdu); font-size: 17px; }
.hero .languages .ar { font-family: var(--arabic); font-size: 17px; }

/* The star and the phone */
.stage { position: relative; display: grid; place-items: center; min-height: 560px; }
/* The logo star: its outline draws itself, it fills with gold, then a shine passes over it now and then. */
.stage .star {
  position: absolute;
  width: min(640px, 118%);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
  animation: breathe 9s ease-in-out 3s infinite;
}
.star-line { fill: none; stroke: #f3dda0; stroke-width: 0.9; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.6, 0, .2, 1) .2s forwards; }
.star-fill { opacity: 0; animation: fill-in 1.4s ease-out 1.7s forwards; }
.star-shine { animation: shine 7s ease-in-out 3.4s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fill-in { to { opacity: 1; } }
@keyframes shine { 0% { transform: skewX(-20deg) translateX(0); } 35%, 100% { transform: skewX(-20deg) translateX(420px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }

/* Little stars twinkling around it */
.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkles svg {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  fill: #f3dda0;
  opacity: 0;
  animation: twinkle 4.5s ease-in-out var(--d) infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0deg); } 45% { opacity: .9; transform: scale(1) rotate(45deg); } 60% { opacity: .9; } }

/* The phone floats */
.phone { animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* Sections rise into view as you scroll (site.js adds .is-visible) */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js .themes[data-reveal] > * { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.js .themes[data-reveal].is-visible > * { opacity: 1; transform: none; }
.js .themes[data-reveal].is-visible > :nth-child(2) { transition-delay: .12s; }
.js .themes[data-reveal].is-visible > :nth-child(3) { transition-delay: .24s; }

/* Calm and still for anyone who turns on Reduce Motion */
@media (prefers-reduced-motion: reduce) {
  .night .lattice, .stage .star, .star-shine, .sparkles svg, .phone { animation: none; }
  .sparkles svg { opacity: .6; }
  .star-line { animation: none; stroke-dashoffset: 0; }
  .star-fill { animation: none; opacity: 1; }
  .js [data-reveal], .js .themes[data-reveal] > * { opacity: 1; transform: none; transition: none; }
}

.phone {
  position: relative;
  width: 272px;
  border-radius: 44px;
  padding: 12px;
  background: linear-gradient(150deg, #1c2a33, #0b1519);
  box-shadow: 0 40px 80px rgba(2, 20, 16, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.screen {
  border-radius: 33px;
  overflow: hidden;
  background: #0a1220;
  color: #f4efe4;
  padding: 16px 14px 18px;
  font-size: 12px;
  line-height: 1.35;
}
.screen .bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.screen .bar b { font: 600 17px/1 var(--serif); }
.screen .bell { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.18); }
.balance {
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(150deg, #0f5c4a, #07342b 70%);
  border: 1px solid rgba(127, 209, 181, 0.25);
}
.balance small { display: block; color: rgba(244, 239, 228, 0.7); margin-bottom: 6px; }
.balance strong { font: 600 26px/1.1 var(--serif); letter-spacing: -0.01em; }
.balance strong em { font-style: normal; font-size: 12px; color: var(--gold); margin-left: 4px; }
.balance .month { display: inline-block; margin-top: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(216, 180, 106, 0.16); color: var(--gold); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.pair div { border-radius: 16px; padding: 10px 12px; background: #101c2e; border: 1px solid #22304a; }
.pair small { color: #a8b2bf; display: block; }
.pair b { font-size: 15px; }
.pair .in b { color: #7fd1b5; }
.pair .out b { color: #f0a58f; }
.row-title { margin: 14px 0 6px; font: 600 13px/1 var(--serif); }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1a2a40; }
.item:last-child { border-bottom: 0; }
.item i { width: 26px; height: 26px; border-radius: 9px; flex: none; }
.item span { flex: 1; }
.item small { color: #a8b2bf; display: block; }
.item b { font-weight: 600; }

/* ---------- Home: what it does ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 88px 20px; }
.section h2 { font: 600 clamp(30px, 4vw, 44px)/1.1 var(--serif); letter-spacing: -0.015em; margin: 0 0 14px; max-width: 18ch; }
.section > p.intro { font-size: 19px; color: var(--muted); max-width: 52ch; margin: 0 0 48px; }

.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 40px; }
.theme svg { width: 44px; height: 44px; margin-bottom: 18px; }
.theme svg * { fill: none; stroke: var(--gold-deep); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { .theme svg * { stroke: var(--gold); } }
.theme h3 { font: 600 24px/1.2 var(--serif); margin: 0 0 10px; }
.theme p { margin: 0 0 14px; color: var(--muted); }
.theme ul { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.theme li { padding: 10px 0; border-bottom: 1px solid var(--line); }

.note-zakat {
  margin: 56px 0 0;
  padding: 20px 24px;
  border-left: 3px solid var(--gold);
  background: var(--soft);
  border-radius: 0 14px 14px 0;
  max-width: 70ch;
  color: var(--ink);
}

/* ---------- Home: privacy, set on paper ---------- */
.privacy-band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; margin: 0; }
.promises div { padding: 22px 0; border-top: 1px solid var(--line); }
.promises dt { font: 600 21px/1.3 var(--serif); margin-bottom: 6px; }
.promises dd { margin: 0; color: var(--muted); max-width: 46ch; }

/* ---------- Home: closing line ---------- */
.closing { text-align: center; }
.closing h2 { margin-left: auto; margin-right: auto; }
.closing p { color: var(--muted); max-width: 48ch; margin: 0 auto 8px; }

/* ---------- Footer (shared) ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.site-footer .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }

/* ---------- Reading pages: Privacy, Terms, Support ---------- */
.page-head .title { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; padding: 28px 20px 56px; }
.page-head .title.lost { padding: 72px 20px 140px; }
.page-head h1 { font: 600 clamp(36px, 5vw, 56px)/1.05 var(--serif); letter-spacing: -0.02em; margin: 0 0 12px; }
.page-head p { margin: 0; color: rgba(244, 239, 228, 0.78); max-width: 60ch; }

.reading {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 20px 88px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.reading.single { grid-template-columns: minmax(0, 1fr); }
.toc { position: sticky; top: 24px; font-size: 15px; }
.toc p { margin: 0 0 10px; font: 600 16px/1.3 var(--serif); }
.toc ol { margin: 0; padding: 0 0 0 20px; color: var(--muted); }
.toc li { margin: 6px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.prose { max-width: 68ch; }
.prose h2 { font: 600 26px/1.25 var(--serif); margin: 48px 0 12px; scroll-margin-top: 20px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font: 600 19px/1.3 var(--serif); margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose .meta { color: var(--muted); font-size: 15px; }
.prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .table-scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { color: var(--muted); font-weight: 600; background: var(--soft); }
.prose .callout { background: var(--soft); border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 18px 0; }
.prose .card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 16px 0; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 72px; gap: 24px; }
  .stage { min-height: 520px; }
  .themes { grid-template-columns: 1fr; gap: 40px; }
  .promises { grid-template-columns: 1fr; }
  .reading { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--paper); }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-nav { gap: 16px; }
  .section { padding: 64px 16px; }
  .hero { padding: 32px 16px 64px; }
  .stage { min-height: 480px; }
  .phone { width: 248px; }
}
