/* Daleel Al-Qibla: colours mirror Shared/Theme.swift */
:root {
  --gold: #e8c76b;          /* Theme.gold      (0.91, 0.78, 0.42) */
  --emerald: #40d99e;       /* Theme.emerald   (0.25, 0.85, 0.62) */
  --sky-top: #081f29;       /* Theme.skyTop    (0.03, 0.12, 0.16) */
  --sky-bottom: #03080d;    /* Theme.skyBottom (0.01, 0.03, 0.05) */
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.75); /* Theme.secondaryText */
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.10);
  --radius: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background-color: var(--sky-bottom);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background-color: var(--sky-bottom);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial,
    "Noto Naskh Arabic", "Geeza Pro", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Night sky and star field as fixed layers. `background-attachment: fixed` is ignored by iOS Safari,
   which would stretch the gradient over the whole page; fixed pseudo-elements stay put everywhere. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background-image:
    radial-gradient(ellipse 70% 45% at 50% 30%, rgba(232, 199, 107, 0.13), transparent 70%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}
body::after {
  opacity: 0.55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 27% 72%, #fff, transparent),
    radial-gradient(2px 2px at 41% 9%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 58% 44%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 66% 86%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 79% 23%, #fff, transparent),
    radial-gradient(2px 2px at 88% 61%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 7% 53%, rgba(255,255,255,.8), transparent),
    radial-gradient(1.5px 1.5px at 34% 38%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 93% 7%, #fff, transparent),
    radial-gradient(1px 1px at 50% 95%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 18% 90%, rgba(255,255,255,.6), transparent);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding:
    max(48px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(64px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

/* Skip link: hidden until focused with the keyboard. */
.skip {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--gold);
  color: var(--sky-bottom);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }
.skip:hover { color: var(--sky-bottom); }

/* Header ---------------------------------------------------------------- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 36px;
  text-decoration: none;
}
.brand img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 18px 48px rgba(0,0,0,.55), 0 0 60px rgba(232,199,107,.18);
  margin-bottom: 12px;
}
.brand .arabic {
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.brand .latin {
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-2);
}

h1 {
  font-size: clamp(1.9rem, 6vw, 2.6rem);
  line-height: 1.15;
  color: var(--gold);
  text-align: center;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.updated {
  text-align: center;
  color: var(--text-2);
  font-size: 0.95rem;
  margin: 0 0 32px;
}

/* Highlight ------------------------------------------------------------- */
.hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(64,217,158,.16), rgba(64,217,158,.04));
  border: 1px solid rgba(64,217,158,.35);
  margin-bottom: 28px;
}
.hero .icon { flex: none; width: 44px; height: 44px; color: var(--emerald); }
.hero strong { display: block; font-size: 1.2rem; color: var(--emerald); }
.hero span { color: var(--text-2); }

/* Cards ----------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px 22px 6px;
  margin-bottom: 18px;
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--text);
}
.card h2 .icon { flex: none; width: 26px; height: 26px; color: var(--gold); }
.card p, .card ul { margin: 0 0 16px; color: var(--text-2); }
.card ul { padding-left: 1.2em; }
.card li { margin-bottom: 6px; }
.card strong { color: var(--text); }

a { color: var(--gold); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: #f3d98f; }
a:focus-visible { outline: 3px solid var(--emerald); outline-offset: 3px; border-radius: 6px; }

/* Landing links --------------------------------------------------------- */
.lead { text-align: center; color: var(--text-2); margin: 12px auto 36px; max-width: 520px; }
.lead-tight { margin-top: 16px; }
.links { display: grid; gap: 14px; }
.button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  transition: border-color .2s, background .2s;
}
.button:hover { color: var(--text); border-color: rgba(232,199,107,.5); background: rgba(232,199,107,.08); }
.button .left { display: flex; align-items: center; gap: 14px; }
.button .icon { width: 26px; height: 26px; color: var(--gold); flex: none; }
.button .chev { color: var(--gold); font-size: 1.4rem; line-height: 1; }

/* Footer ---------------------------------------------------------------- */
footer {
  margin-top: 40px;
  text-align: center;
  color: var(--text-2);
  font-size: 0.9rem;
}
footer nav { display: flex; justify-content: center; gap: 4px 10px; margin-bottom: 6px; flex-wrap: wrap; }
/* At least 44px tall tap targets on phones. */
footer nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
footer nav a[aria-current="page"] { color: var(--text); text-decoration: none; }

@media (max-width: 480px) {
  .page { padding-top: max(32px, env(safe-area-inset-top)); }
  .brand img { width: 80px; height: 80px; }
  .card { padding: 18px 18px 4px; }
  .button { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media print {
  body::before, body::after, .skip { display: none; }
  html, body { background: #fff; color: #000; }
  .card, .hero, .button { background: none; border-color: #999; }
  h1, .brand .arabic, .card h2, .card strong, .hero strong { color: #000; }
  .card p, .card ul, .updated, .lead, footer, .hero span, .brand .latin { color: #222; }
  a { color: #000; }
}
