/* ============================================================================
 * Mawrid — Living Horizon site
 * Vanilla CSS. Self-hosted fonts. No external requests.
 * ==========================================================================*/

/* ── fonts ───────────────────────────────────────────────────────────────── */
@font-face { font-family:"Comfortaa"; font-weight:300 700; font-display:swap;
  src:url("fonts/comfortaa.woff2") format("woff2"); }
@font-face { font-family:"Nunito"; font-weight:400 800; font-display:swap;
  src:url("fonts/nunito.woff2") format("woff2"); }
@font-face { font-family:"Uthmanic Hafs"; font-weight:400; font-display:swap;
  src:url("fonts/uthmanic-hafs.woff2") format("woff2"); }
/* Tajawal (OFL) — rounded Arabic that echoes Comfortaa/Nunito. Used for the
   whole UI when the language is Arabic. Arabic-subset woff2, ~9KB each.
   size-adjust:92% shrinks Tajawal's tall glyphs so Arabic sits closer to the
   optical size of Comfortaa Latin; it only scales this face, not the fallback. */
@font-face { font-family:"Tajawal"; font-weight:400; font-display:swap; size-adjust:92%;
  src:url("fonts/tajawal.woff2") format("woff2"); unicode-range:U+0600-06FF,U+0750-077F,U+FB50-FDFF,U+FE70-FEFF,U+0660-0669; }
@font-face { font-family:"Tajawal"; font-weight:700; font-display:swap; size-adjust:92%;
  src:url("fonts/tajawal-bold.woff2") format("woff2"); unicode-range:U+0600-06FF,U+0750-077F,U+FB50-FDFF,U+FE70-FEFF,U+0660-0669; }
/* Changa (OFL) — Arabic display face for the Mawrid wordmark + slogan in Arabic. */
@font-face { font-family:"Changa"; font-weight:400 700; font-display:swap;
  src:url("fonts/changa.woff2") format("woff2"); }

/* ── animatable palette custom properties ────────────────────────────────── */
/* Only the gliding stops are registered (so they interpolate smoothly). ink /
 * muted / accent are deliberately NOT registered — they must snap, not tween. */
@property --sky-0 { syntax:"<color>"; inherits:true; initial-value:#05130F; }
@property --sky-1 { syntax:"<color>"; inherits:true; initial-value:#0A2A20; }
@property --sky-2 { syntax:"<color>"; inherits:true; initial-value:#123F31; }
@property --glow  { syntax:"<color>"; inherits:true; initial-value:#2E6E5A; }

/* ── tokens ──────────────────────────────────────────────────────────────── */
:root{
  /* one easing family — no overshoot, ever */
  --e-quiet: cubic-bezier(0.16, 1, 0.30, 1);
  --e-soft:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --e-water: cubic-bezier(0.33, 0.02, 0.18, 1);
  --e-calm:  cubic-bezier(0.65, 0, 0.35, 1);
  --d-tap:140ms; --d-ui:260ms; --d-enter:760ms; --d-slow:1400ms; --d-sky:900ms;

  --surface: color-mix(in oklab, var(--sky-1) 62%, transparent);
  --surface-2: color-mix(in oklab, var(--sky-2) 40%, transparent);
  --hair: color-mix(in oklab, var(--ink) 15%, transparent);
  --hair-soft: color-mix(in oklab, var(--ink) 8%, transparent);

  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:24px; --r-pill:999px;
  --wrap:1120px; --gutter:clamp(20px, 5vw, 56px);

  --sh: 0 1px 2px color-mix(in oklab, var(--sky-0) 55%, transparent),
        0 10px 30px -12px color-mix(in oklab, var(--sky-0) 70%, transparent),
        0 34px 68px -34px color-mix(in oklab, var(--sky-0) 80%, transparent);

  /* Comfortaa across all English content, to match the logo wordmark; Nunito is
     a metrics-compatible fallback. Tajawal leads the stack but is @font-face-
     restricted to Arabic ranges, so it only ever paints stray Arabic glyphs
     (e.g. the "العربية" toggle while in English) — Latin always falls to Comfortaa. */
  --f-ui: "Tajawal", "Comfortaa", "Nunito", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-dis: "Tajawal", "Comfortaa", "Nunito", ui-sans-serif, system-ui, sans-serif;
  --f-ar: "Uthmanic Hafs", serif;
}

/* Two attributes drive the palette:
 *   data-sky  → the three sky stops + glow, which GLIDE (transitioned)
 *   data-tone → ink / muted / accent, which SNAP (no transition)
 * app.js sets data-sky immediately and data-tone at the sky's midpoint, so the
 * background eases dark→light while the text ink flips crisply halfway —
 * avoiding the gray-on-gray moment you get if both cross the middle together. */
html{
  --sky-0:#05130F; --sky-1:#0A2A20; --sky-2:#123F31;
  --ink:#EAF3EE; --muted:#9DB6AA; --accent:#43C79C; --glow:#2E6E5A;
  transition:
    --sky-0 900ms var(--e-water), --sky-1 900ms var(--e-water),
    --sky-2 900ms var(--e-water), --glow 900ms var(--e-water);
}
/* sky stops (glide) — each phase's stops sit in one tonal band matched to ink */
html[data-sky="fajr"]   { --sky-0:#05130F; --sky-1:#0A2A20; --sky-2:#123F31; --glow:#2E6E5A; }
html[data-sky="shuruq"] { --sky-0:#0B241C; --sky-1:#12352A; --sky-2:#1C4A3A; --glow:#E0A268; }
html[data-sky="duha"]   { --sky-0:#DCEAE0; --sky-1:#EAF2EC; --sky-2:#F4F8F4; --glow:#FFE9C4; }
html[data-sky="dhuhr"]  { --sky-0:#DFEDE6; --sky-1:#EEF5F0; --sky-2:#FFFFFF; --glow:#FFFFFF; }
html[data-sky="asr"]    { --sky-0:#E6EDDF; --sky-1:#F1EFE2; --sky-2:#F7ECD6; --glow:#F3CE93; }
html[data-sky="maghrib"]{ --sky-0:#0F2236; --sky-1:#1B2F44; --sky-2:#2A3A4E; --glow:#E8AE68; }
html[data-sky="isha"]   { --sky-0:#04120F; --sky-1:#081F19; --sky-2:#0E2C22; --glow:#1D5A47; }
html[data-sky="layl"]   { --sky-0:#020A08; --sky-1:#05150F; --sky-2:#0A251C; --glow:#144233; }
/* ink / muted / accent (snap) — every value clears WCAG AA vs its own sky band */
html[data-tone="fajr"]   { --ink:#EAF3EE; --muted:#9DB6AA; --accent:#43C79C; }
html[data-tone="shuruq"] { --ink:#F0E9DC; --muted:#C7B79E; --accent:#F0B978; }
html[data-tone="duha"]   { --ink:#152019; --muted:#4A574F; --accent:#0E6046; }
html[data-tone="dhuhr"]  { --ink:#111311; --muted:#4C5852; --accent:#0F5138; }
html[data-tone="asr"]    { --ink:#1B2016; --muted:#54594A; --accent:#0D4E39; }
html[data-tone="maghrib"]{ --ink:#F4ECDD; --muted:#C9BEA9; --accent:#F0B36B; }
html[data-tone="isha"]   { --ink:#DCE9E1; --muted:#89A093; --accent:#3CC194; }
html[data-tone="layl"]   { --ink:#CFE0D7; --muted:#7E958A; --accent:#38B98D; }

/* ── reset / base ────────────────────────────────────────────────────────── */
*{ box-sizing:border-box; }
html,body{ margin:0; }
html{ scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body{
  font-family:var(--f-ui); color:var(--ink);
  background:var(--sky-1); /* base fill; the gradient lives on the fixed .sky-layers */
  line-height:1.62; letter-spacing:0.002em;
  overflow-x:hidden; min-height:100vh;
  /* color must NOT transition — the tone snap (data-tone) is what times it. */
}
img{ max-width:100%; height:auto; display:block; }
a{ color:inherit; }
:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; border-radius:4px; }

.wrap{ width:100%; max-width:var(--wrap); margin-inline:auto; padding-inline:var(--gutter); }
.wrap--narrow{ max-width:760px; }
.center{ text-align:center; }

.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }
.skip-link{ position:fixed; top:-60px; inset-inline-start:16px; z-index:100; background:var(--accent);
  color:var(--sky-0); padding:10px 16px; border-radius:var(--r-md); font-weight:700;
  transition:top var(--d-ui) var(--e-soft); }
.skip-link:focus{ top:16px; }

/* ── ambient sky layers ──────────────────────────────────────────────────── */
/* Fixed, so the gradient never repaints on scroll (no background-attachment). */
.sky-layers{ position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in oklab, var(--glow) 40%, transparent), transparent 60%),
    linear-gradient(180deg, var(--sky-0) 0%, var(--sky-1) 52%, var(--sky-2) 100%); }
.sky-pattern{ position:absolute; inset:-5%; opacity:0.5;
  color:var(--accent);
  -webkit-mask-image:radial-gradient(130% 90% at 50% 8%, #000 30%, transparent 78%);
          mask-image:radial-gradient(130% 90% at 50% 8%, #000 30%, transparent 78%);
  transition:opacity var(--d-sky) var(--e-water);
  animation:pan 140s linear infinite; will-change:transform; }
@keyframes pan{ to{ transform:translate3d(-6%, -4%, 0); } }
.sky-stars{ position:absolute; inset:0; width:100%; height:100%;
  opacity:0; transition:opacity 1600ms var(--e-water); }
html[data-sky="fajr"] .sky-stars,
html[data-sky="isha"] .sky-stars,
html[data-sky="layl"] .sky-stars{ opacity:0.9; }
html[data-sky="maghrib"] .sky-stars{ opacity:0.45; }
.sky-grain{ position:absolute; inset:0; opacity:0.035; mix-blend-mode:soft-light;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ── cursor glow — a soft trailing light in the phase's glow colour ──────── */
/* Sits behind the content (screen-blended over the sky), so it lights the
   background near the pointer without washing out text. Calm and subtle. */
.cursor-glow{ position:fixed; top:0; left:0; width:clamp(200px, 26vw, 360px); aspect-ratio:1;
  border-radius:50%; pointer-events:none; z-index:0; opacity:0; will-change:transform, opacity;
  transition:opacity 500ms var(--e-soft); mix-blend-mode:screen;
  background:radial-gradient(circle, color-mix(in oklab, var(--glow) 62%, transparent) 0%, transparent 68%); }
.cursor-glow.on{ opacity:0.5; }

/* everything above the sky */
main, .foot{ position:relative; z-index:1; }
/* topbar must sit ABOVE main (same z-index + later DOM would let main eat clicks) */
.topbar{ z-index:20; }

/* ── reveal (scroll-triggered, with reduced-motion fallback) ─────────────── */
.reveal{ opacity:0; transform:translate3d(0, 18px, 0);
  transition:opacity var(--d-enter) var(--e-quiet), transform var(--d-enter) var(--e-quiet); }
.reveal.is-in{ opacity:1; transform:none; }

/* ── top bar ─────────────────────────────────────────────────────────────── */
.topbar{ position:sticky; top:0; display:flex; align-items:center; gap:24px;
  min-height:72px; line-height:1.2; padding:12px var(--gutter); backdrop-filter:blur(14px) saturate(1.1);
  background:color-mix(in oklab, var(--sky-0) 46%, transparent);
  border-bottom:1px solid var(--hair-soft);
  transition:background var(--d-sky) var(--e-water), border-color var(--d-sky) var(--e-water),
    opacity 220ms var(--e-soft); }

/* Language-switch crossfade — the content dissolves, the sky stays, and the
   layout reflow (LTR↔RTL) happens while hidden. */
main, .foot{ transition:opacity 220ms var(--e-soft); }
html.lang-anim :is(main, .topbar, .foot){ opacity:0; }
.brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); }
/* Wordmark: Comfortaa in English, Changa in Arabic. */
.brand-word{ font-family:"Comfortaa","Nunito",ui-sans-serif,system-ui,sans-serif;
  font-weight:600; font-size:1.32rem; letter-spacing:0.02em; }
html[lang="ar"] .brand-word{ font-family:"Changa","Tajawal","Noto Naskh Arabic",sans-serif;
  font-weight:700; font-size:1.34rem; letter-spacing:0; }
.brand-draw .stroke{ stroke-dasharray:var(--len,900); stroke-dashoffset:var(--len,900);
  animation:draw 1400ms var(--e-quiet) 120ms forwards; }
@keyframes draw{ to{ stroke-dashoffset:0; } }
/* The "m" mark is the logo in every language; the Arabic meem variant is retired. */
.brand-latin{ display:block; }
.brand-meem{ display:none; }
.topnav{ display:flex; gap:22px; margin-inline-start:auto; font-size:0.95rem; }
.topnav a{ text-decoration:none; color:var(--muted); transition:color var(--d-ui) var(--e-soft); }
.topnav a:hover{ color:var(--ink); }
/* The language toggle and the "Add to Chrome" CTA share the same end slot and
   swap: at the top the toggle shows; once scrolled past the hero the CTA takes
   its place. Only ever one of the two is visible. */
/* The language toggle and the CTA share one slot and CROSSFADE on scroll —
   stacked in the same grid cell so neither shifts the layout. */
.topbar-end{ margin-inline-start:auto; display:grid; place-items:center; min-height:40px; }
.topbar-end > *{ grid-area:1 / 1; }
/* both directions must animate — specific enough to beat each element's own
   `transition` (the toggle's border/colour, the button's transform/background). */
.topbar-end .lang-toggle{ transition:opacity 300ms var(--e-soft), transform 300ms var(--e-soft),
  border-color var(--d-ui) var(--e-soft), color var(--d-ui) var(--e-soft); }
.topbar-end .topbar-cta{ transition:opacity 300ms var(--e-soft), transform 300ms var(--e-soft),
  background var(--d-ui) var(--e-soft), color var(--d-ui) var(--e-soft); }
.topbar .lang-toggle{ opacity:1; transform:none; }
.topbar .topbar-cta{ opacity:0; transform:translateY(-6px) scale(0.96); pointer-events:none; }
.topbar.scrolled .lang-toggle{ opacity:0; transform:translateY(6px) scale(0.96); pointer-events:none; }
.topbar.scrolled .topbar-cta{ opacity:1; transform:none; pointer-events:auto; }
@media (max-width:820px){ .topnav{ display:none; } }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family:var(--f-ui); font-weight:700; font-size:1rem; text-decoration:none;
  padding:13px 26px; border-radius:var(--r-pill); border:1px solid transparent;
  cursor:pointer; transition:transform var(--d-tap) var(--e-soft),
    box-shadow var(--d-ui) var(--e-soft), background var(--d-ui), color var(--d-ui),
    border-color var(--d-ui); white-space:nowrap; }
.btn:active{ transform:translateY(1px) scale(0.99); }
.btn-primary{ background:var(--accent); color:var(--sky-0);
  box-shadow:0 8px 26px -10px color-mix(in oklab, var(--accent) 80%, transparent); }
.btn-primary:hover{ box-shadow:0 12px 34px -10px color-mix(in oklab, var(--accent) 90%, transparent);
  transform:translateY(-2px); }
.btn-quiet, .btn-ghost{ background:transparent; color:var(--ink);
  border-color:var(--hair); }
.btn-quiet:hover, .btn-ghost:hover{ border-color:var(--accent); color:var(--accent); }
.btn-ghost{ padding:9px 18px; font-size:0.92rem; }
.btn-lg{ padding:17px 40px; font-size:1.1rem; }

/* ── shared section type ─────────────────────────────────────────────────── */
section{ padding-block:clamp(72px, 11vw, 152px); }
.eyebrow, .section-eyebrow{ font-family:var(--f-dis); font-weight:600;
  font-size:0.82rem; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--accent); margin:0 0 18px; }
.section-head{ font-family:var(--f-dis); font-weight:600;
  font-size:clamp(1.9rem, 1.2rem + 3vw, 3.3rem); line-height:1.06;
  letter-spacing:-0.02em; margin:0 0 20px; max-width:16ch; }
.section-lede{ font-size:clamp(1.05rem, 1rem + 0.4vw, 1.28rem); color:var(--muted);
  max-width:56ch; margin:0 0 44px; }

/* ── Quran radio feature points ──────────────────────────────────────────── */
.radio-points{ list-style:none; margin:6px 0 0; padding:0; display:grid; gap:20px; max-width:640px; }
.radio-points li{ display:grid; gap:3px; padding-inline-start:18px; border-inline-start:2px solid var(--fern); }
.radio-points strong{ font-family:var(--f-dis); font-weight:600; font-size:1.08rem; color:var(--ink); }
.radio-points span{ color:var(--muted); font-size:0.98rem; line-height:1.5; }
.radio-shots{ display:flex; flex-wrap:nowrap; gap:22px; margin:34px 0 40px; align-items:flex-start; justify-content:flex-start; }
.radio-shots img{ flex:1 1 0; min-width:0; max-width:330px; height:auto; border-radius:20px; box-shadow:0 26px 64px rgba(10,40,30,0.22); }
@media (max-width:460px){ .radio-shots{ flex-wrap:wrap; } .radio-shots img{ flex-basis:100%; max-width:320px; } }

/* ── hero ────────────────────────────────────────────────────────────────── */
.hero{ min-height:100svh; display:flex; flex-direction:column; justify-content:center;
  padding-top:8vh; position:relative; }
.hero-inner{ max-width:900px; }
.hero-title{ font-family:var(--f-dis); font-weight:600;
  font-size:clamp(2.9rem, 1.4rem + 6.4vw, 6.4rem); line-height:1.06;
  letter-spacing:-0.028em; margin:0 0 28px; }
/* padding+negative margin gives descenders room inside the overflow:hidden mask */
.hero-title .line{ display:block; overflow:hidden; padding-bottom:0.14em; margin-bottom:-0.14em; }
.hero-title .ink{ display:inline-block; transform:translateY(110%);
  animation:riseIn 1000ms var(--e-quiet) forwards; }
.hero-title .line:nth-child(2) .ink{ animation-delay:110ms; }
@keyframes riseIn{ to{ transform:none; } }
.hero-sub{ font-size:clamp(1.12rem, 1rem + 0.7vw, 1.42rem); color:var(--muted);
  max-width:52ch; margin:0 0 34px; line-height:1.55; }
.hero-actions{ display:flex; flex-wrap:wrap; gap:14px; align-items:center; }
.hero-micro{ margin:22px 0 0; color:var(--muted); font-size:0.92rem; letter-spacing:0.01em; }
.hero-clock{ margin-top:40px; display:inline-flex; align-items:center; gap:12px;
  padding:12px 20px; border-radius:var(--r-pill); border:1px solid var(--hair);
  background:color-mix(in oklab, var(--sky-1) 40%, transparent);
  font-size:0.96rem; color:var(--ink); max-width:100%; }
/* Keep clock + prayer times left-to-right so the Arabic day-period marker (ص/م)
   trails the numerals ("4:54 م") instead of being reordered in front of them
   inside the RTL sentence. Isolated so it doesn't disturb the surrounding text. */
#hcText strong, .hz-time{ direction:ltr; unicode-bidi:isolate; }
.hc-dot{ width:8px; height:8px; border-radius:50%; background:var(--accent);
  box-shadow:0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent);
  animation:pulse 2.6s var(--e-calm) infinite; flex:none; }
@keyframes pulse{ 0%,100%{ box-shadow:0 0 0 0 color-mix(in oklab, var(--accent) 55%, transparent); }
  50%{ box-shadow:0 0 0 7px transparent; } }
.hc-text strong{ font-weight:800; color:var(--accent); }
.hero-scrollcue{ position:absolute; left:50%; bottom:30px; translate:-50% 0;
  width:26px; height:42px; border:1.5px solid var(--hair); border-radius:14px; }
.hero-scrollcue span{ position:absolute; left:50%; top:8px; translate:-50% 0;
  width:3px; height:8px; border-radius:2px; background:var(--accent);
  animation:cue 1.8s var(--e-calm) infinite; }
@keyframes cue{ 0%{ opacity:0; transform:translateY(0); } 40%{ opacity:1; } 80%{ opacity:0; transform:translateY(14px); } }

/* ── verse well ──────────────────────────────────────────────────────────── */
.wellcard{ position:relative; margin:0; padding:clamp(30px, 5vw, 68px);
  border-radius:var(--r-xl); background:var(--surface);
  border:1px solid var(--hair); box-shadow:var(--sh);
  backdrop-filter:blur(8px);
  transition:background var(--d-sky) var(--e-water), border-color var(--d-sky) var(--e-water); }
.well-bracket{ position:absolute; width:44px; height:44px; border-color:var(--accent);
  border-style:solid; border-width:0; opacity:0.7; }
/* Only the far corner bracket — the marker tab owns the near (start) corner. */
.well-bracket--tl{ display:none; }
.well-bracket--br{ bottom:20px; right:20px; border-bottom-width:2px; border-right-width:2px;
  border-bottom-right-radius:14px; }
.well-body{ position:relative; }
/* Bookmark tab on the inline-start edge, like the extension: tall, rounded top,
   an accent glow, and a chevron notch at the foot. It sits in front of the
   corner bracket (z-index) so the two read as one intentional frame. */
.well-marker{ position:absolute; z-index:3; top:44px; inset-inline-start:16px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
  width:58px; height:124px; padding:14px 6px; line-height:1; color:var(--accent);
  border:1px solid var(--hair); border-radius:26px 26px 10px 10px; box-shadow:var(--sh);
  background:
    radial-gradient(circle at 50% 20%, color-mix(in oklab, var(--accent) 22%, transparent), transparent 46%),
    color-mix(in oklab, var(--sky-1) 96%, transparent);
  transition:background var(--d-sky) var(--e-water), border-color var(--d-sky) var(--e-water); }
.wm-label{ font-size:0.66rem; letter-spacing:0.06em; color:var(--muted); }
.wm-num{ font-family:var(--f-dis); font-weight:600; font-size:1.5rem; color:var(--accent); }
.wm-surah{ font-size:0.6rem; color:var(--muted); letter-spacing:0.1em; }
/* Verse styling matches the shipped extension exactly (same font + text + size),
 * so the mushaf marks — including the silent-alif circle on ءَامَنُوا۟ — sit as
 * they do in the product. letter-spacing must stay off: any inherited tracking
 * detaches Arabic combining marks. */
.ayah{ font-family:var(--f-ar); direction:rtl; text-align:center; text-wrap:balance;
  font-size:clamp(1.7rem, 1.1rem + 2.4vw, 2.7rem); line-height:2; margin:0 0 30px;
  color:var(--ink); font-weight:400; letter-spacing:normal; word-spacing:normal; }
.translation{ font-size:clamp(1.08rem, 1rem + 0.5vw, 1.34rem); line-height:1.6;
  text-align:center; max-width:60ch; margin:0 auto 26px; color:var(--ink); font-weight:600; }
.well-ref{ display:flex; gap:12px; justify-content:center; align-items:center;
  color:var(--muted); font-size:0.9rem; }
.well-ref-sep{ opacity:0.5; }
.verse-note{ margin:38px auto 0; max-width:52ch; text-align:center; color:var(--muted);
  font-size:0.98rem; font-style:italic; }
@media (max-width:700px){ .well-marker{ position:static; flex-direction:row; gap:8px;
  align-items:baseline; margin-bottom:20px; width:max-content; height:auto; padding:10px 14px;
  border-radius:var(--r-md); }
  .well-marker::after{ display:none; } }

/* ── prayer horizon ──────────────────────────────────────────────────────── */
.horizoncard{ padding:clamp(24px, 4vw, 44px); border-radius:var(--r-xl);
  background:var(--surface); border:1px solid var(--hair); box-shadow:var(--sh);
  backdrop-filter:blur(8px); overflow:hidden;
  transition:background var(--d-sky) var(--e-water), border-color var(--d-sky) var(--e-water); }
.hz-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:16px;
  flex-wrap:wrap; margin-bottom:8px; }
.hz-title{ font-family:var(--f-dis); font-weight:600; font-size:1.1rem; margin:0; }
.hz-place{ margin:4px 0 0; color:var(--muted); font-size:0.9rem; }
.hz-next{ font-family:var(--f-dis); font-weight:600; font-size:clamp(1.05rem,0.9rem+0.6vw,1.4rem);
  color:var(--accent); margin:0; text-align:end; }
.hz-arc{ position:relative; height:120px; margin:14px 0 8px; color:var(--muted);
  border-radius:var(--r-md);
  /* a soft horizon glow rising from the baseline, in the phase's glow colour */
  background:linear-gradient(to top, color-mix(in oklab, var(--glow) 16%, transparent), transparent 62%); }
.hz-arc-svg{ position:absolute; inset:0; width:100%; height:100%; }
/* the sun by day, a pale moon by night — placed at the real celestial position */
.hz-sun{ position:absolute; width:16px; height:16px; border-radius:50%;
  background:var(--glow); left:50%; top:50%; translate:-50% -50%;
  box-shadow:0 0 22px 6px color-mix(in oklab, var(--glow) 70%, transparent);
  transition:left 300ms var(--e-water), top 300ms var(--e-water), background 600ms var(--e-water); }
.hz-times{ list-style:none; margin:16px 0 0; padding:0; display:grid;
  grid-template-columns:repeat(6, 1fr); gap:8px; text-align:center; }
.hz-times li{ padding:14px 6px; border-radius:var(--r-md);
  border:1px solid transparent; transition:background var(--d-ui), border-color var(--d-ui); }
.hz-times li.is-next{ background:color-mix(in oklab, var(--accent) 14%, transparent);
  border-color:color-mix(in oklab, var(--accent) 40%, transparent); }
/* the prayer window we're currently in — a quiet accent dot + brighter name */
.hz-times li.is-current{ position:relative; }
.hz-times li.is-current .hz-name{ color:var(--accent); }
.hz-times li.is-current::after{ content:""; position:absolute; inset-inline-start:50%; bottom:5px;
  transform:translateX(-50%); width:5px; height:5px; border-radius:50%; background:var(--accent); }
.hz-name{ display:block; font-size:0.78rem; letter-spacing:0.06em; text-transform:uppercase; color:var(--muted); }
.hz-time{ display:block; font-family:var(--f-dis); font-weight:600; font-size:clamp(0.95rem,0.8rem+0.5vw,1.2rem);
  margin-top:6px; color:var(--ink); }
.hz-disclaimer{ margin:22px 0 0; padding-top:18px; border-top:1px solid var(--hair-soft);
  color:var(--muted); font-size:0.86rem; max-width:64ch; }
@media (max-width:640px){ .hz-times{ grid-template-columns:repeat(3,1fr); }
  .hz-next{ text-align:start; } }

/* ── privacy ─────────────────────────────────────────────────────────────── */
.privacy-grid{ display:grid; grid-template-columns:repeat(2, 1fr); gap:18px; }
.pcard{ padding:clamp(24px, 3.4vw, 38px); border-radius:var(--r-lg);
  background:var(--surface); border:1px solid var(--hair);
  transition:background var(--d-sky) var(--e-water), border-color var(--d-sky) var(--e-water),
    transform var(--d-ui) var(--e-soft); }
.pcard:hover{ transform:translateY(-3px); }
.pcard--wide{ grid-column:span 2; }
.pcard h3{ font-family:var(--f-dis); font-weight:600; font-size:1.24rem; margin:0 0 12px; }
.pcard p{ margin:0 0 8px; color:var(--muted); }
.perm-list, .deny-list{ list-style:none; margin:16px 0 0; padding:0; }
.perm-list li{ display:flex; gap:14px; align-items:baseline; padding:11px 0;
  border-top:1px solid var(--hair-soft); }
.perm-list code{ font-family:ui-monospace, "SF Mono", Menlo, monospace; font-size:0.86rem;
  color:var(--accent); background:color-mix(in oklab, var(--accent) 12%, transparent);
  padding:3px 9px; border-radius:6px; flex:none; }
.perm-list span{ color:var(--ink); }
.deny-list li{ padding:8px 0; padding-inline-start:26px; position:relative; color:var(--muted); }
.deny-list li::before{ content:""; position:absolute; inset-inline-start:0; top:50%; transform:translateY(-50%);
  width:14px; height:1.5px; background:currentColor; opacity:0.6; }
.pcard-foot{ margin-top:16px; font-size:0.88rem; }
.pcard code, .pcard-foot code{ font-family:ui-monospace, Menlo, monospace; font-size:0.85em; }
.connect-src{ display:block; margin-top:16px; padding:18px 20px; border-radius:var(--r-md);
  background:color-mix(in oklab, var(--sky-0) 32%, transparent);
  border:1px solid var(--hair-soft);
  font-family:ui-monospace, "SF Mono", Menlo, monospace; font-size:0.92rem; line-height:2;
  color:var(--accent); }
.cs-label{ display:block; font-family:var(--f-ui); color:var(--muted); font-size:0.82rem;
  letter-spacing:0.04em; margin-bottom:8px; }
/* Each host is an isolated LTR token so it renders correctly even inside the
   RTL Arabic block; the chevron flips to point at the text in RTL. */
.cs-host{ display:block; unicode-bidi:isolate; }
.cs-host::before{ content:"›"; opacity:0.5; margin-inline-end:8px; }
html[lang="ar"] .cs-host::before{ content:"‹"; }
@media (max-width:720px){ .privacy-grid{ grid-template-columns:1fr; } .pcard--wide{ grid-column:auto; } }

/* ── sources ─────────────────────────────────────────────────────────────── */
.source-rows{ border-top:1px solid var(--hair); }
.srow{ display:grid; grid-template-columns:180px 1fr; gap:24px; padding:24px 4px;
  border-bottom:1px solid var(--hair); }
.srow-k{ font-family:var(--f-dis); font-weight:600; color:var(--accent); font-size:1.02rem; }
.srow-v{ color:var(--muted); font-size:1.04rem; }
.srow-v strong{ color:var(--ink); font-weight:700; }
@media (max-width:620px){ .srow{ grid-template-columns:1fr; gap:6px; } }

/* ── customise / shots ───────────────────────────────────────────────────── */
.shots{ display:grid; grid-template-columns:repeat(2, 1fr); gap:18px; }
.shot{ margin:0; border-radius:var(--r-lg); overflow:hidden; border:1px solid var(--hair);
  background:var(--surface); box-shadow:var(--sh); }
.shot--lg{ grid-column:span 2; }
.shot img{ width:100%; transition:transform 1200ms var(--e-water); }
.shot:hover img{ transform:scale(1.02); }
.shot figcaption{ padding:12px 18px; color:var(--muted); font-size:0.9rem; }
@media (max-width:640px){ .shots{ grid-template-columns:1fr; } .shot--lg{ grid-column:auto; } }

/* ── everything (feature columns) ────────────────────────────────────────── */
.feat-cols{ display:grid; grid-template-columns:repeat(4, 1fr); gap:36px 28px; margin-top:8px; }
.feat-group h3{ font-family:var(--f-dis); font-weight:600; font-size:1.16rem; margin:0 0 16px;
  padding-bottom:12px; border-bottom:1px solid var(--hair); }
.feat-group ul{ list-style:none; margin:0; padding:0; }
.feat-group li{ padding:7px 0; padding-inline-start:20px; position:relative; color:var(--muted); font-size:0.98rem; }
.feat-group li::before{ content:""; position:absolute; inset-inline-start:0; top:0.85em; width:6px; height:6px;
  border-radius:50%; background:var(--accent); opacity:0.65; }
.notdo{ margin-top:56px; padding:clamp(24px,3.4vw,40px); border-radius:var(--r-lg);
  border:1px dashed var(--hair); background:color-mix(in oklab, var(--sky-1) 30%, transparent); }
.notdo h3{ font-family:var(--f-dis); font-weight:600; font-size:1.2rem; margin:0 0 10px; }
.notdo p{ margin:0; color:var(--muted); max-width:64ch; }
@media (max-width:900px){ .feat-cols{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:520px){ .feat-cols{ grid-template-columns:1fr; } }

/* ── platforms ───────────────────────────────────────────────────────────── */
.plat-group{ margin-bottom:26px; }
.plat-label{ font-family:var(--f-dis); font-weight:600; font-size:0.8rem;
  letter-spacing:0.1em; text-transform:uppercase; color:var(--muted); margin:0 0 12px; }
.plat-row{ display:flex; flex-wrap:wrap; gap:12px; }
.plat{ display:flex; flex-direction:column; gap:3px; min-width:150px; text-align:start;
  padding:16px 20px; border-radius:var(--r-md); border:1px solid var(--hair);
  background:var(--surface); font-family:var(--f-ui); cursor:pointer; color:var(--ink);
  text-decoration:none; transition:transform var(--d-ui) var(--e-soft),
    border-color var(--d-ui), background var(--d-ui); }
.plat:hover{ transform:translateY(-3px); border-color:var(--accent); }
.plat-name{ font-family:var(--f-dis); font-weight:600; font-size:1.06rem; }
.plat-state{ font-size:0.82rem; color:var(--muted); }
.plat--live{ border-color:color-mix(in oklab, var(--accent) 55%, transparent);
  background:color-mix(in oklab, var(--accent) 14%, var(--surface)); }
.plat--live .plat-state{ color:var(--accent); font-weight:700; }
.plat--soon{ opacity:0.82; }
.plat--soon .plat-name{ color:var(--muted); }

.waitlist{ margin-top:36px; padding:clamp(24px,3.4vw,36px); border-radius:var(--r-lg);
  background:var(--surface); border:1px solid var(--hair); max-width:600px; }
.wl-label{ display:block; font-family:var(--f-dis); font-weight:600; font-size:1.08rem; margin-bottom:14px; }
.wl-label span{ color:var(--accent); }
.wl-row{ display:flex; gap:10px; flex-wrap:wrap; }
.wl-input{ flex:1 1 220px; padding:13px 18px; border-radius:var(--r-pill);
  border:1px solid var(--hair); background:color-mix(in oklab, var(--sky-0) 26%, transparent);
  color:var(--ink); font-family:var(--f-ui); font-size:1rem; }
.wl-input::placeholder{ color:color-mix(in oklab, var(--muted) 80%, transparent); }
.wl-input:focus-visible{ border-color:var(--accent); outline:2px solid var(--accent); outline-offset:2px; }
.wl-micro{ margin:14px 0 0; color:var(--muted); font-size:0.85rem; }
.wl-status{ margin:12px 0 0; font-size:0.94rem; font-weight:700; min-height:1.2em; color:var(--accent); }
.wl-status.err{ color:#ff9d92; }

/* ── maker ───────────────────────────────────────────────────────────────── */
.maker-note{ margin:0; padding:clamp(28px,4vw,48px); border-inline-start:3px solid var(--accent);
  border-start-start-radius:0; border-end-start-radius:0;
  border-start-end-radius:var(--r-lg); border-end-end-radius:var(--r-lg); background:var(--surface); }
.maker-note p{ font-size:clamp(1.1rem,1rem+0.5vw,1.34rem); line-height:1.62; margin:0 0 18px; }
.maker-sign{ display:flex; flex-wrap:wrap; gap:6px 18px; align-items:baseline; margin-top:8px; }
.maker-name{ font-family:var(--f-dis); font-weight:600; color:var(--ink); }
.maker-mail{ color:var(--accent); font-size:0.95rem; }

/* ── faq ─────────────────────────────────────────────────────────────────── */
.faq-list{ margin:8px 0 0; }
.faq-item{ padding:22px 0; border-bottom:1px solid var(--hair); }
.faq-item dt{ font-family:var(--f-dis); font-weight:600; font-size:1.1rem; margin-bottom:8px; }
.faq-item dd{ margin:0; color:var(--muted); max-width:62ch; }

/* ── final ───────────────────────────────────────────────────────────────── */
.final{ text-align:center; }
.final-title{ font-family:var(--f-dis); font-weight:600;
  font-size:clamp(1.9rem,1.3rem+2.6vw,3.1rem); letter-spacing:-0.02em;
  margin:0 auto 32px; max-width:16ch; }

/* ── footer ──────────────────────────────────────────────────────────────── */
.foot{ padding-block:64px; border-top:1px solid var(--hair);
  background:color-mix(in oklab, var(--sky-0) 40%, transparent); }
.foot-inner{ display:grid; grid-template-columns:1.2fr 1fr 1.6fr; gap:40px; }
.foot-mark{ width:38px; height:38px; color:var(--ink); }
.foot-brand{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.foot-brand .brand-word{ color:var(--ink); }
.foot-brand p{ flex-basis:100%; margin:12px 0 0; color:var(--muted); font-size:0.92rem;
  font-family:"Comfortaa","Nunito",ui-sans-serif,system-ui,sans-serif; }
html[lang="ar"] .foot-brand p{ font-family:"Changa","Tajawal","Noto Naskh Arabic",sans-serif; font-weight:500; }
.foot-nav{ display:flex; flex-direction:column; gap:10px; }
.foot-nav a{ text-decoration:none; color:var(--muted); transition:color var(--d-ui); }
.foot-nav a:hover{ color:var(--ink); }
.foot-meta{ color:var(--muted); font-size:0.86rem; }
.foot-meta p{ margin:0 0 10px; }
.foot-meta a{ color:var(--accent); text-decoration:none; }
.foot-copy{ opacity:0.8; }
@media (max-width:760px){ .foot-inner{ grid-template-columns:1fr; gap:28px; } }

/* ── language toggle (compact: ع / EN) ───────────────────────────────────── */
.lang-toggle{ font-family:"Tajawal","Comfortaa","Nunito",ui-sans-serif,sans-serif; font-weight:600;
  font-size:0.9rem; line-height:1; padding:9px 17px; text-align:center;
  border-radius:var(--r-pill); border:1px solid var(--hair);
  background:transparent; color:var(--ink); cursor:pointer; white-space:nowrap;
  transition:border-color var(--d-ui) var(--e-soft), color var(--d-ui) var(--e-soft); }
.lang-toggle:hover{ border-color:var(--accent); color:var(--accent); }

/* ── Arabic: rounded Tajawal for the whole UI, and RTL polish ─────────────── */
/* Tajawal is @font-face-restricted to the Arabic Unicode ranges, so Latin text
   (Chrome, Quran.com, "Mawrid", etc.) skips it and renders in Comfortaa/Nunito —
   the same faces as the English site. */
html[lang="ar"]{
  --f-ui: "Tajawal", "Comfortaa", "Nunito", "Noto Sans Arabic", "Geeza Pro", "Segoe UI", sans-serif;
  --f-dis: "Tajawal", "Comfortaa", "Noto Naskh Arabic", "Geeza Pro", sans-serif;
}
/* Tajawal has 400/700 only — display text uses 700 for the same presence
   Comfortaa 600 gives in Latin. The mushaf verse font is untouched. */
html[lang="ar"] :is(.hero-title, .section-head, .final-title,
  .eyebrow, .section-eyebrow, .plat-label, .hz-title, .wm-label,
  .srow-k, .feat-group h3, .pcard h3, .notdo h3, .faq-item dt, .maker-name){
  font-weight:700; }
/* Arabic reads well a touch larger and more open than the Latin defaults. */
html[lang="ar"] body{ letter-spacing:0; line-height:1.8; }
/* Keep the Arabic headline to two lines like the English (one per .line span).
   nowrap stops the longer first line wrapping; the clamp is sized from the
   measured width/font ratio so it never overflows down to ~300px. */
/* flex-column so the .line paddings below don't margin-collapse (which would
   spread the two lines apart); flex items keep their exact stacked positions. */
html[lang="ar"] .hero-title{ letter-spacing:0; line-height:1.3;
  font-size:clamp(1.85rem, 9.2vw, 6rem);
  display:flex; flex-direction:column; align-items:flex-start; }
html[lang="ar"] .hero-title .ink{ white-space:nowrap; }
/* Arabic marks overshoot .line's reveal mask on BOTH edges — kasra/kasratan and
   the comma hang low, dammatan/tall marks rise high — and the 0.14em Latin
   descender room clips them. Extend the clip box top+bottom; the matching
   negative margin (no collapse under flex) keeps the layout unchanged. */
html[lang="ar"] .hero-title .line{ padding-block:0.34em; margin-block:-0.34em; }
html[lang="ar"] .section-head, html[lang="ar"] .final-title{ letter-spacing:0; line-height:1.35; }
html[lang="ar"] .eyebrow, html[lang="ar"] .section-eyebrow, html[lang="ar"] .plat-label{ letter-spacing:0.04em; }
/* In Arabic the card is RTL (it shows an Arabic tafseer under the ayah). The
   ayah keeps its own dir="rtl"; the tafseer + attribution flow with the page. */
html[lang="ar"] .translation{ font-family:var(--f-ui); }

/* ── floating recitation player ──────────────────────────────────────────── */
.player{ position:fixed; inset-block-end:24px; inset-inline-start:24px; z-index:30;
  display:flex; align-items:center; gap:12px; }
.player-btn{ width:58px; height:58px; flex:none; border-radius:50%; border:none; cursor:pointer;
  display:grid; place-items:center; color:var(--sky-0); background:var(--accent);
  box-shadow:0 12px 30px -8px color-mix(in oklab, var(--accent) 70%, transparent), var(--sh);
  transition:transform var(--d-ui) var(--e-soft), background var(--d-sky) var(--e-water); }
.player-btn:hover{ transform:translateY(-2px); }
.player-btn:active{ transform:translateY(0) scale(0.97); }
.player-btn svg{ grid-area:1 / 1; } /* stack play + pause in the same cell */
.player:not(.is-playing) .ic-pause{ display:none; }
.player.is-playing .ic-play{ display:none; }
.player.is-playing .player-btn{ animation:playerPulse 2.6s var(--e-calm) infinite; }
@keyframes playerPulse{
  0%,100%{ box-shadow:0 0 0 0 color-mix(in oklab, var(--accent) 45%, transparent), var(--sh); }
  50%{ box-shadow:0 0 0 13px transparent, var(--sh); } }
.player-info{ display:flex; align-items:center; gap:10px; padding:10px 16px; border-radius:var(--r-pill);
  background:var(--surface); border:1px solid var(--hair); box-shadow:var(--sh); backdrop-filter:blur(8px);
  color:var(--ink); font-size:0.9rem; white-space:nowrap; max-width:min(58vw,320px); overflow:hidden;
  text-overflow:ellipsis; animation:playerIn 320ms var(--e-quiet); }
@keyframes playerIn{ from{ opacity:0; transform:translateX(8px) scale(0.96); } to{ opacity:1; transform:none; } }
.eq{ display:inline-flex; align-items:flex-end; gap:2px; height:14px; flex:none; }
.eq i{ width:3px; height:45%; background:var(--accent); border-radius:2px; }
.player.is-playing .eq i{ animation:eq 900ms var(--e-calm) infinite; }
.player.is-playing .eq i:nth-child(2){ animation-delay:160ms; }
.player.is-playing .eq i:nth-child(3){ animation-delay:320ms; }
@keyframes eq{ 0%,100%{ height:28%; } 50%{ height:100%; } }
@media (max-width:560px){ .player{ inset-block-end:16px; inset-inline-start:16px; }
  .player-btn{ width:52px; height:52px; } .player-info{ font-size:0.84rem; max-width:52vw; } }

/* ── scroll-to-top (icon only; opposite corner from the player) ──────────── */
.to-top{ position:fixed; inset-block-end:24px; inset-inline-end:24px; z-index:30;
  width:46px; height:46px; border-radius:50%; display:grid; place-items:center;
  border:1px solid var(--hair); background:var(--surface); color:var(--ink);
  cursor:pointer; box-shadow:var(--sh); backdrop-filter:blur(8px);
  opacity:0; transform:translateY(8px) scale(0.9); pointer-events:none;
  transition:opacity 300ms var(--e-soft), transform 300ms var(--e-soft),
    border-color var(--d-ui) var(--e-soft), color var(--d-ui) var(--e-soft); }
.to-top.show{ opacity:1; transform:none; pointer-events:auto; }
.to-top:hover{ border-color:var(--accent); color:var(--accent); transform:translateY(-2px); }
.to-top:active{ transform:translateY(0) scale(0.96); }
.to-top svg{ display:block; }
@media (max-width:560px){ .to-top{ inset-block-end:16px; inset-inline-end:16px; width:42px; height:42px; } }

/* ── reduced motion: honour it fully ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *, *::before, *::after{ animation-duration:0.001ms !important; animation-iteration-count:1 !important;
    transition-duration:0.001ms !important; }
  .reveal{ opacity:1 !important; transform:none !important; }
  .hero-title .ink{ transform:none !important; }
  .sky-pattern{ animation:none !important; will-change:auto !important; }
  /* phase palette still applies — it's a static theme, just no tween */
}
