/* The website's front page, on the shared Midnight Emerald tokens (theme.css).
   Logical properties throughout, so Arabic/Urdu (RTL) and the other nine
   languages (LTR) lay out from the same rules. */

:root {
  --land-max: 1120px;
  --land-gap: clamp(16px, 4vw, 32px);
  --glass: rgba(5, 34, 31, 0.62);
  --glass-border: rgba(58, 212, 170, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-display, system-ui), system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
/* Arabic script: system UI fonts read best at body sizes; Amiri for the headings. */
html:lang(ar) body, html:lang(ur) body { font-family: "Segoe UI", Tahoma, system-ui, sans-serif; }
html:lang(ar) :is(h1, h2, h3, .next-name), html:lang(ur) :is(h1, h2, h3, .next-name) { font-family: "Amiri", "Segoe UI", serif; }
[hidden] { display: none !important; }
a { color: inherit; }

/* ---- background: soft glows over an eight-point star lattice ---- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(58, 212, 170, 0.18), transparent 60%),
    radial-gradient(50rem 36rem at -10% 30%, rgba(238, 188, 74, 0.08), transparent 60%),
    radial-gradient(40rem 30rem at 50% 110%, rgba(0, 120, 100, 0.22), transparent 60%),
    var(--background);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%233ad4aa' stroke-width='1'%3E%3Cpath d='M32 8l7 17 17 7-17 7-7 17-7-17-17-7 17-7z'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

/* ---- top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--land-max);
  margin: 0 auto;
  padding: 12px var(--land-gap);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(1, 22, 18, 0.85), rgba(1, 22, 18, 0.55));
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand img { border-radius: 9px; }
.lang-picker { position: relative; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  color: var(--foreground);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.lang-btn:hover { border-color: var(--primary); }
.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 4px;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.lang-item {
  font: inherit;
  font-size: 14px;
  text-align: start;
  color: var(--foreground);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.lang-item:hover, .lang-item:focus-visible { background: var(--secondary); }
.lang-item[aria-pressed="true"] { color: var(--primary); font-weight: 700; }

/* ---- hero ---- */
main { max-width: var(--land-max); margin: 0 auto; padding: 0 var(--land-gap); }
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  padding: clamp(32px, 7vw, 88px) 0 clamp(24px, 5vw, 56px);
}
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  background: rgba(238, 188, 74, 0.1);
  border: 1px solid rgba(238, 188, 74, 0.25);
  direction: ltr;
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.15;
  background: linear-gradient(120deg, #eef7f5 10%, var(--primary) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { font-size: clamp(17px, 2.2vw, 21px); color: var(--muted-foreground); margin: 0 0 26px; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 26px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn.primary { color: var(--primary-foreground); background: linear-gradient(135deg, #46e2b8, #22b893); box-shadow: var(--shadow-glow); }
.btn.ghost { color: var(--foreground); background: var(--glass); border: 1px solid var(--glass-border); }
.btn:hover { transform: translateY(-2px); }
.btn.ghost:hover { border-color: var(--primary); }
.note { font-size: 13.5px; color: var(--muted-foreground); margin: 18px 0 0; max-width: 36em; }

/* ---- live preview: a phone with today's prayers ---- */
.preview { display: flex; justify-content: center; }
.phone {
  position: relative;
  width: min(320px, 100%);
  padding: 34px 18px 20px;
  border-radius: 36px;
  background: var(--gradient-card);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  transform: rotate(-2deg);
}
[dir="rtl"] .phone { transform: rotate(2deg); }
.phone-notch { position: absolute; top: 12px; inset-inline: 0; margin: 0 auto; width: 70px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); }
.next {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 12px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: var(--gradient-next);
  border: 1px solid var(--next-item-border);
  text-align: center;
}
.next-label { font-size: 12px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.06em; }
.next-name { font-size: 24px; font-weight: 700; }
.next-in { font-size: 14px; color: var(--primary); font-variant-numeric: tabular-nums; }
.times { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.times li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  font-size: 15px;
}
.times li.is-next { border-color: var(--next-item-border); background: rgba(58, 212, 170, 0.1); }
.times li.is-past { opacity: 0.5; }
.t-at { font-variant-numeric: tabular-nums; font-weight: 700; }
.sample { margin: 12px 4px 0; font-size: 12px; color: var(--muted-foreground); text-align: center; }

/* ---- sections ---- */
.block { padding: clamp(28px, 5vw, 56px) 0; }
h2 {
  margin: 0 0 22px;
  font-size: clamp(24px, 3.4vw, 34px);
  text-align: center;
}
h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
}

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  padding: 22px 20px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: rgba(58, 212, 170, 0.4); }
.f-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 14px;
  font-size: 24px;
  background: linear-gradient(135deg, rgba(58, 212, 170, 0.2), rgba(238, 188, 74, 0.12));
}
.feature h3 { margin: 0 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted-foreground); font-size: 15px; }

.downloads { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.downloads li { flex: 1 1 300px; max-width: 360px; }
.platform {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  text-decoration: none;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.platform:hover { transform: translateY(-2px); border-color: var(--primary); background: rgba(58, 212, 170, 0.08); }
.pf-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--primary);
  background: rgba(58, 212, 170, 0.12);
}
.pf-icon svg { width: 26px; height: 26px; }
.pf-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.pf-text b { font-size: 16px; }
.pf-text small { color: var(--muted-foreground); font-size: 13px; }
.pf-go { color: var(--muted-foreground); font-size: 18px; }
[dir="rtl"] .pf-go { transform: scaleX(-1); }

.lang-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.chip {
  font: inherit;
  font-size: 15px;
  color: var(--foreground);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { color: var(--primary-foreground); background: var(--primary); border-color: var(--primary); font-weight: 700; }

/* ---- footer ---- */
.foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px var(--land-gap) 40px;
  margin-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.foot img { border-radius: 7px; opacity: 0.8; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; }
.foot a { color: var(--muted-foreground); text-decoration: none; }
.foot a:hover { color: var(--primary); }

.btn:focus-visible, .platform:focus-visible, .chip:focus-visible, .lang-btn:focus-visible, .lang-item:focus-visible, a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ---- entrance (calm, and off for reduced motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  .hero-text, .preview, .feature, .platform { animation: rise 0.6s ease-out backwards; }
  .preview { animation-delay: 0.12s; }
  .feature:nth-child(2), .platform:nth-child(2) { animation-delay: 0.05s; }
  .feature:nth-child(3), .platform:nth-child(3) { animation-delay: 0.1s; }
  .feature:nth-child(4), .platform:nth-child(4) { animation-delay: 0.15s; }
  .feature:nth-child(5), .platform:nth-child(5) { animation-delay: 0.2s; }
  .feature:nth-child(6), .platform:nth-child(6) { animation-delay: 0.25s; }
  .feature:nth-child(7) { animation-delay: 0.3s; }
  .feature:nth-child(8) { animation-delay: 0.35s; }
  .feature:nth-child(9) { animation-delay: 0.4s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .feature, .platform { transition: none; }
}

/* ---- narrow screens ---- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .cta { justify-content: center; }
  .tagline, .note { margin-inline: auto; }
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .features { grid-template-columns: 1fr; }
  .brand span { font-size: 15px; }
  .lang-menu { grid-template-columns: 1fr 1fr; inset-inline-end: -8px; }
  .phone, [dir="rtl"] .phone { transform: none; }
  .btn { flex: 1 1 100%; }
}
