/* Miqat's own page. The type is the app's: SF Pro Rounded, heavy headings, a
   light countdown. The hero is the app's sky (sky.js sets --sky-* and the ink
   for the sky over Makkah right now); the rest is its night. */

@property --sky-top { syntax: "<color>"; inherits: true; initial-value: #33406E; }
@property --sky-mid { syntax: "<color>"; inherits: true; initial-value: #6E5A86; }
@property --sky-horizon { syntax: "<color>"; inherits: true; initial-value: #CF7A5F; }

:root {
  --night: #060A18;
  --night-2: #0B1224;
  --night-3: #131B3F;
  --text: #F4F6FF;
  --muted: #AEB7D2;
  --muted-2: #7D87A8;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --warm: #F0B386;
  --dusk: #CF7A5F;
  --day: #84B4E3;
  --navy: #0E2238;
  --sweep: linear-gradient(105deg, #A7CBEB 0%, #C6C3E2 36%, #E8D0C2 64%, #F0B386 100%);
  --ink: #F4F6FF;
  --ink-soft: rgba(244, 246, 255, 0.78);
  --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;
  --radius: 28px;
  --maxw: 1160px;
  color-scheme: dark;
}
:root[data-light="true"] { --ink: #0E2238; --ink-soft: rgba(14, 34, 56, 0.74); }
@media (prefers-reduced-motion: no-preference) {
  :root { transition: --sky-top 2s ease, --sky-mid 2s ease, --sky-horizon 2s ease; }
}

* { 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(--text);
  font-family: var(--round); font-size: 17px; line-height: 1.6;
  -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; }
.wrap { position: relative; z-index: 2; max-width: var(--maxw); margin: 0 auto; padding: 0 26px; }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 3px; border-radius: 8px; }

/* ---------- Ambient night, tinted by the live horizon ---------- */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 82% 0%, color-mix(in srgb, var(--sky-horizon) 22%, transparent), transparent 64%),
    radial-gradient(55% 40% at 10% 30%, rgba(110, 90, 134, 0.22), transparent 62%),
    radial-gradient(70% 50% at 50% 110%, rgba(132, 180, 227, 0.10), transparent 70%),
    linear-gradient(180deg, var(--night-2) 0%, var(--night) 100%);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.03; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Nav: a bar of the live sky ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; color: var(--ink);
  background: color-mix(in srgb, var(--sky-top) 78%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(16px); backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 12px 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span { font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { text-decoration: none; color: var(--ink-soft); font-size: 0.95rem; font-weight: 600; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  padding: 8px 16px; border-radius: 999px; font-weight: 700 !important; color: var(--sky-top) !important;
  background: var(--ink); transition: transform .18s;
}
.nav-cta:hover { transform: translateY(-1px); }
/* The other language stays in the bar on phones, beside Download. */
.nav-links .nav-lang { padding-inline-start: 20px; border-inline-start: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); }
@media (max-width: 760px) { .nav-links a:not(.nav-cta):not(.nav-lang) { display: none; } .nav-links .nav-lang { padding-inline-start: 0; border-inline-start: 0; } }

/* ---------- Hero: the live sky ---------- */
.hero {
  position: relative; z-index: 2; color: var(--ink); overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 58%, var(--sky-horizon) 100%);
}
.stars { position: absolute; inset: 0; pointer-events: none; opacity: var(--stars, 0); transition: opacity 2s; }
.stars i {
  position: absolute; width: var(--size); height: var(--size); border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
}
@media (prefers-reduced-motion: no-preference) {
  .stars i { animation: twinkle 6s ease-in-out infinite; }
  @keyframes twinkle { 50% { opacity: 0.35; } }
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; padding: 56px 26px 0; z-index: 3; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink) 26%, transparent);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em; color: var(--ink-soft);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 10px var(--warm); }
.hero h1 { font-size: clamp(2.7rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -0.02em; font-weight: 560; margin: 20px 0 20px; }
.lede { color: var(--ink-soft); font-size: 1.16rem; max-width: 33em; margin: 0 0 28px; }
.cta-row { display: flex; align-items: center; gap: 18px; 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); }
.hero-note { color: var(--ink-soft); font-size: 0.92rem; font-weight: 600; }
/* The phone rises from behind the glass horizon. */
.hero-phone { position: relative; display: flex; justify-content: center; align-self: start; margin-bottom: -250px; }
.hero-phone .phone { max-width: 262px; }
.hero.is-live .hero-copy { padding-bottom: 8px; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 44px; }
  .hero-phone { display: none; }
}
.hero:not(.is-live) .hero-phone { margin-bottom: 40px; }

/* The live band: the app's hero, its sun path, and the list on a glass horizon. */
.live { display: none; position: relative; }
.hero.is-live .live { display: block; }
.readout { position: relative; z-index: 2; padding-top: 28px; }
.readout .place { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--ink-soft); }
.readout .label { margin: 6px 0 0; font-size: 1.15rem; font-weight: 600; }
.readout .count { margin: -4px 0 0; font-size: clamp(3.4rem, 8vw, 5rem); font-weight: 300; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.readout .count small { font-size: 0.32em; font-weight: 600; letter-spacing: 0; margin-inline-start: 0.15em; }
.sunpath { position: relative; z-index: 1; display: block; width: 100%; margin-top: -10px; }
.glass {
  position: relative; z-index: 4; margin-top: -46px; padding: 16px 0 22px;
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  border-top: 1px solid rgba(255, 255, 255, 0.35);
}
:root[data-light="true"] .glass { background: rgba(255, 255, 255, 0.36); }
.prayers { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.prayers li { padding: 10px 14px; border-radius: 16px; display: flex; flex-direction: column; gap: 2px; }
.prayers .name { font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.prayers .time { font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.prayers .time small { font-size: 0.6em; font-weight: 600; margin-inline-start: 3px; }
.prayers .tomorrow { font-size: 0.72rem; font-weight: 700; opacity: 0.75; }
.prayers li.is-current { background: rgba(255, 255, 255, 0.2); }
:root[data-light="true"] .prayers li.is-current { background: rgba(255, 255, 255, 0.62); }
.prayers li.is-next .name::after { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 2px solid currentColor; }
.prayers li.is-past { opacity: 0.58; }
.glass-note { margin: 12px auto 0; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
@media (max-width: 860px) {
  .prayers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .prayers li { padding: 8px 10px; }
  .prayers .time { font-size: 1.12rem; }
}

/* ---------- Phones, watches and the iPad ---------- */
.phone {
  position: relative; width: 100%; max-width: 320px; padding: 9px;
  background: linear-gradient(155deg, #2C3550 0%, #0B0F1C 100%); border-radius: 46px;
  box-shadow: 0 44px 90px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.phone img { width: 100%; border-radius: 38px; }
.phone-glow { position: absolute; inset: -40px; z-index: -1; filter: blur(50px); opacity: 0.8;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--sky-horizon) 55%, transparent), transparent 64%); }
.duo { display: grid; place-items: center; padding: 26px 0; }
.duo .phone { grid-area: 1 / 1; width: min(64%, 250px); padding: 7px; border-radius: 36px; }
.duo .phone img { border-radius: 29px; }
.duo .phone--back { transform: translate(30%, -6%) rotate(4deg) scale(0.9); opacity: 0.92; }
.duo .phone--front { transform: translate(-24%, 8%) rotate(-3deg); z-index: 2; }
.single { display: flex; justify-content: center; position: relative; }
.single .phone { max-width: 290px; }
.watch-strip { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 26px 22px; padding: 40px 0 8px; position: relative; }
.watch-strip::before { content: ""; position: absolute; inset: 14% 10%; z-index: -1; filter: blur(56px);
  background: radial-gradient(ellipse at center, rgba(240, 179, 134, 0.16), transparent 72%); }
.watch { width: 172px; padding: 10px 9px; border-radius: 48px;
  background: linear-gradient(158deg, #34373E 0%, #0A0B0E 100%);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform .25s ease; }
.watch img { width: 100%; border-radius: 40px; }
.watch:hover { transform: translateY(-4px); }
@media (max-width: 520px) { .watch { width: 140px; border-radius: 40px; } .watch img { border-radius: 33px; } }
.ipad { max-width: 560px; margin: 0 auto; padding: 14px; border-radius: 40px;
  background: linear-gradient(155deg, #2C3550 0%, #0B0F1C 100%);
  box-shadow: 0 44px 90px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.ipad img { border-radius: 28px; }
@media (prefers-reduced-motion: reduce) { .watch, .appstore img, .nav-cta { transition: none; } }

/* ---------- Sections ---------- */
main { position: relative; z-index: 2; }
.section-eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--warm); }
.grad { background: var(--sweep); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-weight: 600; letter-spacing: -0.015em; line-height: 1.08; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--border); }
.stat { padding: 26px 12px; text-align: center; border-inline-end: 1px solid var(--border); }
.stat:last-child { border-inline-end: none; }
.stat-num { font-size: 2.1rem; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } .stat:nth-child(3) { border-inline-end: none; } .stat:nth-child(n+4) { border-top: 1px solid var(--border); } }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; padding: 88px 0; }
.feature + .feature { border-top: 1px solid var(--border); }
.feature--rev .f-text { order: 2; }
.feature h2 { font-size: clamp(2rem, 3.7vw, 2.8rem); margin: 14px 0 18px; }
.f-lede { color: var(--muted); font-size: 1.08rem; margin: 0 0 24px; max-width: 30em; }
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.points li { display: flex; gap: 12px; align-items: baseline; color: var(--text); font-weight: 500; }
.points li::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; transform: translateY(-1px);
  background: radial-gradient(circle at 35% 35%, #fff, var(--warm) 70%); box-shadow: 0 0 10px rgba(240, 179, 134, 0.7); }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 36px; padding: 64px 0; text-align: center; }
  .feature--rev .f-text { order: 0; }
  .f-lede { margin-left: auto; margin-right: auto; }
  .points { max-width: 26em; margin: 0 auto; text-align: start; }
}

.band { padding: 88px 0; border-top: 1px solid var(--border); }
.band-head { text-align: center; max-width: 660px; margin: 0 auto 44px; }
.band-head h2 { font-size: clamp(2rem, 3.8vw, 2.9rem); margin: 14px 0 14px; }
.band-head p { color: var(--muted); font-size: 1.07rem; margin: 0; }

.extras-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .extras-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .extras-grid { grid-template-columns: 1fr; } }
.extra { padding: 26px; border-radius: 24px; border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)); }
.extra svg { width: 30px; height: 30px; color: var(--warm); margin-bottom: 14px; }
.extra strong { display: block; font-size: 1.12rem; font-weight: 600; margin-bottom: 6px; }
.extra p { margin: 0; color: var(--muted); font-size: 0.98rem; }

/* The App Store header's crescent sits above the words: the image is at least
   560px tall (1307px wide), wider on wider screens, and the words start below
   the crescent (about 43% of the image's height) at every width. */
.final { position: relative; text-align: center; padding: max(350px, calc(18.5vw + 110px)) 26px 110px; overflow: hidden; border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(11, 18, 36, 0) 40%, var(--night-2) 77%),
    url("../img/crescent.jpg") center top / max(100%, 1307px) auto no-repeat, var(--night-2); }
.final h2 { font-size: clamp(2.2rem, 4.6vw, 3.3rem); margin: 0 0 16px; text-shadow: 0 2px 20px rgba(6, 10, 24, 0.4); }
.final p { color: rgba(244, 246, 255, 0.86); max-width: 30em; margin: 0 auto 30px; font-size: 1.08rem; }

footer.foot { position: relative; z-index: 2; border-top: 1px solid var(--border); }
.foot-inner { max-width: var(--maxw); margin: 0 auto; padding: 30px 26px 40px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 0.92rem; }
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand img { width: 28px; height: 28px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; font-weight: 600; }
.foot a:hover { color: var(--text); }

/* ---------- Arabic (/ar/miqat/), 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, .brand span, .eyebrow, .section-eyebrow) { letter-spacing: 0; }
:root[lang="ar"] .hero h1 { line-height: 1.25; font-weight: 600; }
:root[lang="ar"] h2 { line-height: 1.3; }
:root[lang="ar"] .section-eyebrow { text-transform: none; font-size: 0.9rem; }
