/* ================================================
   Tathbeet Al-Hifz – site stylesheet
   Palette taken from the final_v5 store screenshots:
   dark "mesh" hero, pastel "ice" feature panels,
   app colors (gold logo, navy, cream) for UI.
   Screenshots are the raw app screens (no baked-in
   titles), framed as phones in CSS.
   ================================================ */

:root {
  /* Hero mesh */
  --mesh-1: #0B2143;
  --mesh-2: #0E2B52;
  --mesh-3: #123A63;
  --mesh-4: #14356A;
  --mesh-5: #2B6FA8;
  --mesh-6: #1C7A9E;
  --mesh-7: #3FB6C4;
  --mesh-8: #4E8FD6;
  --mesh-9: #5BC9CE;
  --hero-sub: #CEE8F8;

  /* Ice panels */
  --ice-1: #A9E9FB;
  --ice-2: #8CDDF6;
  --ice-3: #78E4EC;
  --ice-4: #84C4FA;
  --ice-5: #7FA8F7;
  --ice-6: #A3B4FC;
  --ice-7: #BFAAF6;

  /* App colors */
  --gold: #D4A857;
  --gold-accent: #C9982E;
  --gold-light: #F0DCA0;
  --navy: #1A2744;
  --cream: #FCF9F4;
  --card: #F5EFE3;
  --muted: #7C7568;
  --ink: #000000;

  /* Semantic */
  --ok: #2E7D32;
  --mid: #C9982E;
  --warn: #FF9800;
  --bad: #D32F2F;
  --cov-blue: #1565C0;
  --cov-yellow: #FDD835;
  --cov-none: #E8E0D0;

  --r-panel: 40px;
  --r-card: 24px;
  --r-btn: 20px;
  --shadow-soft: 0 18px 40px -18px rgba(11, 33, 67, .35), 0 2px 8px rgba(11, 33, 67, .06);
  --shadow-shot: 0 30px 60px -24px rgba(11, 33, 67, .45);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Noto Naskh Arabic", "Inter", system-ui, sans-serif;
  --gutter: 20px;
  --header-h: 68px;
}

/* ── Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--navy);
  background: var(--cream);
  overflow-x: hidden;
  transition: opacity .2s ease;
}
html[lang="ar"] body { font-family: var(--font-ar); line-height: 1.85; }
html[lang="ar"] * { letter-spacing: 0 !important; }
.i18n-pending body { opacity: 0; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 700; }
p { margin: 0; }
svg { flex: none; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
@media (max-width: 480px) { :root { --gutter: 16px; } }

.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: var(--navy); padding: 10px 16px; border-radius: 12px;
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
section[id], [id="download"] { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ── Backgrounds ────────────────────────────────── */
.mesh {
  background-color: var(--mesh-1);
  background-image:
    radial-gradient(55% 45% at 8% 100%, rgba(91, 201, 206, .70) 0%, transparent 70%),
    radial-gradient(45% 40% at 28% 78%, rgba(63, 182, 196, .55) 0%, transparent 70%),
    radial-gradient(50% 45% at 95% 55%, rgba(78, 143, 214, .55) 0%, transparent 70%),
    radial-gradient(45% 40% at 60% 90%, rgba(28, 122, 158, .55) 0%, transparent 70%),
    radial-gradient(60% 50% at 70% 20%, rgba(43, 111, 168, .45) 0%, transparent 70%),
    linear-gradient(170deg, var(--mesh-1) 0%, var(--mesh-2) 30%, var(--mesh-3) 60%, var(--mesh-4) 100%);
  color: #fff;
}
.ice-a {
  background:
    radial-gradient(70% 60% at 0% 0%, var(--ice-1) 0%, transparent 70%),
    radial-gradient(60% 70% at 100% 100%, var(--ice-7) 0%, transparent 70%),
    linear-gradient(125deg, var(--ice-2) 0%, var(--ice-4) 100%);
}
.ice-b {
  background:
    radial-gradient(70% 60% at 100% 0%, var(--ice-3) 0%, transparent 70%),
    radial-gradient(60% 70% at 0% 100%, var(--ice-6) 0%, transparent 70%),
    linear-gradient(235deg, var(--ice-1) 0%, var(--ice-4) 100%);
}
.ice-c {
  background:
    radial-gradient(70% 60% at 0% 100%, var(--ice-3) 0%, transparent 70%),
    radial-gradient(60% 70% at 100% 0%, var(--ice-7) 0%, transparent 70%),
    linear-gradient(145deg, var(--ice-1) 0%, var(--ice-5) 100%);
}
.ice-d {
  background:
    radial-gradient(70% 60% at 100% 100%, var(--ice-2) 0%, transparent 70%),
    radial-gradient(60% 70% at 0% 0%, var(--ice-6) 0%, transparent 70%),
    linear-gradient(200deg, var(--ice-3) 0%, var(--ice-4) 100%);
}

/* ── Instagram bar ──────────────────────────────── */
.insta-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  min-height: 42px; padding: 7px var(--gutter);
  background: linear-gradient(90deg, #FBEAF3 0%, var(--cream) 30%, var(--cream) 70%, #E9EDFC 100%);
  color: var(--navy); font-size: .9rem; font-weight: 600; text-decoration: none;
}
.insta-bar:focus-visible { outline-offset: -4px; border-radius: 0; }
.insta-badge {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff;
  background: radial-gradient(circle at 30% 107%, #FDF497 0%, #FDF497 5%, #FD5949 45%, #D6249F 60%, #285AEB 90%);
  box-shadow: 0 4px 10px -4px rgba(214, 36, 159, .6);
}
.insta-badge svg { width: 16px; height: 16px; }
.insta-bar strong {
  font-family: var(--font); font-weight: 700; color: #833AB4;
  background: linear-gradient(90deg, #C13584, #833AB4 55%, #405DE6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.insta-arrow { width: 16px; height: 16px; transition: transform .2s ease; }
.insta-bar:hover .insta-arrow { transform: translateX(3px); }
html[dir="rtl"] .insta-arrow { transform: scaleX(-1); }
html[dir="rtl"] .insta-bar:hover .insta-arrow { transform: translateX(-3px) scaleX(-1); }
@media (max-width: 400px) {
  .insta-bar { gap: 8px; font-size: .8rem; }
  .insta-arrow { display: none; }
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 33, 67, .78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
}
.site-header .container {
  display: flex; align-items: center; gap: 16px; min-height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
@media (max-width: 440px) { .brand span { display: none; } }

.lang-switch {
  display: inline-flex; padding: 4px; gap: 2px; margin: 0; list-style: none;
  border-radius: 999px; background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
}
.lang-switch a {
  display: block; padding: 5px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  text-decoration: none; color: rgba(255, 255, 255, .8);
  font-family: var(--font);
}
.lang-switch a:hover { color: #fff; }
.lang-switch a.active { background: #fff; color: var(--navy); }

.btn-gold {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold); color: var(--navy);
  padding: 10px 18px; border-radius: var(--r-btn);
  font-weight: 700; font-size: .92rem; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(212, 168, 87, .9);
  transition: background .2s ease, transform .2s ease;
}
.btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
@media (max-width: 380px) { .btn-gold { padding: 9px 12px; } }

/* ── Store buttons ──────────────────────────────── */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 190px; padding: 11px 20px 11px 16px;
  border-radius: var(--r-btn); text-decoration: none;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
html[dir="rtl"] .store-btn { padding: 11px 16px 11px 20px; }
.store-btn:hover { transform: translateY(-2px); }
.store-btn svg { width: 26px; height: 26px; }
.store-btn span { display: flex; flex-direction: column; line-height: 1.15; text-align: start; }
.store-btn small { font-size: .72rem; font-weight: 600; opacity: .8; }
.store-btn strong { font-size: 1.12rem; font-weight: 700; font-family: var(--font); }
.store-btn--light { background: #fff; color: var(--navy); box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .55); }
.store-btn--ghost { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .28); }
.store-btn--ghost:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); }

/* ── Hero ───────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 56px 0 72px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 72px 0 96px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 64px; }
}
.hero-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5); }
.eyebrow-light {
  margin-top: 22px; font-size: .8rem; font-weight: 700; letter-spacing: .28em;
  text-transform: uppercase; color: rgba(255, 255, 255, .82);
}
.hero h1 {
  margin-top: 10px; color: #fff;
  font-size: clamp(2.5rem, 6.2vw, 4.4rem); line-height: 1.04; letter-spacing: -.03em;
}
html[lang="ar"] .hero h1 { line-height: 1.3; }
.hero-sub { margin-top: 16px; color: var(--hero-sub); font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 600; }
.hero-intro { margin-top: 14px; max-width: 540px; color: rgba(255, 255, 255, .78); font-size: 1.05rem; }
.hero .stores { margin-top: 30px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; list-style: none; }
.pills li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  color: var(--hero-sub); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
}
.pills svg { width: 15px; height: 15px; color: var(--gold); }
.hero-media { justify-self: center; width: min(78vw, 340px); }
.hero-media .phone {
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .75), inset 0 0 0 1px rgba(255, 255, 255, .18), 0 0 0 1px rgba(255, 255, 255, .12);
}

/* ── Panels (feature sections) ─────────────────── */
.features { padding: 24px 0 8px; }
.panel {
  position: relative; overflow: hidden;
  border-radius: var(--r-panel);
  padding: clamp(28px, 5vw, 64px);
  margin-top: 24px;
}
.feature { display: grid; gap: 36px; align-items: center; }
.feature-media { order: 2; justify-self: center; width: min(72vw, 330px); }
/* Raw app screens shown inside a CSS phone frame */
.phone {
  padding: 9px; border-radius: 49px;
  background: linear-gradient(150deg, #2A3656 0%, #0B1224 100%);
  box-shadow: var(--shadow-shot), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.phone img { width: 100%; border-radius: 40px; background: var(--cream); }
.dash-card .phone { padding: 8px; border-radius: 39px; }
.dash-card .phone img { border-radius: 31px; }
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature-media { order: 0; }
  .panel--flip .feature-media { order: 2; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .62); color: var(--navy);
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
html[lang="ar"] .eyebrow { font-size: .9rem; }
.eyebrow--card { background: var(--card); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.feature h2, .section-head h2 {
  margin-top: 16px;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.12; letter-spacing: -.025em;
}
html[lang="ar"] .feature h2, html[lang="ar"] .section-head h2 { line-height: 1.45; }
.lead { margin-top: 14px; font-size: 1.1rem; color: rgba(26, 39, 68, .86); max-width: 560px; }

.points {
  list-style: none; margin: 26px 0 0; padding: 6px;
  background: rgba(255, 255, 255, .72); border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
}
.points li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; line-height: 1.5; }
.points li + li { border-top: 1px solid rgba(26, 39, 68, .08); }
.points strong { color: var(--ink); }
.ic {
  flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: #fff; margin-top: -2px;
}
.ic svg { width: 16px; height: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px; background: var(--cream);
  font-size: .84rem; font-weight: 600; color: var(--navy);
  border: 1px solid rgba(26, 39, 68, .08);
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot--ok { background: var(--ok); }
.dot--mid { background: var(--mid); }
.dot--warn { background: var(--warn); }
.dot--bad { background: var(--bad); }

/* Spaced repetition: rating → next review */
.outcomes {
  margin-top: 16px; padding: 18px 20px;
  background: rgba(255, 255, 255, .72); border-radius: var(--r-card); box-shadow: var(--shadow-soft);
}
.outcomes-title { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.outcomes ul { list-style: none; margin: 10px 0 0; padding: 0; }
.outcomes li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.3fr);
  align-items: center; gap: 12px; padding: 9px 0;
}
.outcomes li + li { border-top: 1px dashed rgba(26, 39, 68, .12); }
.outcomes .rating { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.outcomes .arrow { width: 18px; height: 18px; color: var(--muted); }
html[dir="rtl"] .outcomes .arrow { transform: scaleX(-1); }
.outcomes .next { color: var(--navy); }

/* ── Dashboard ──────────────────────────────────── */
.section-head { text-align: center; max-width: 720px; margin-inline: auto; }
.section-head .lead { margin-inline: auto; }
.dash-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 80%);
  gap: 20px; margin: 40px calc(var(--gutter) * -1) 0; padding: 4px var(--gutter) 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.dash-card {
  scroll-snap-align: center;
  display: flex; flex-direction: column; gap: 18px;
  background: rgba(255, 255, 255, .55); border-radius: 32px; padding: 20px 20px 24px;
  border: 1px solid rgba(255, 255, 255, .7);
}
.dash-card .shot { width: min(100%, 260px); margin-inline: auto; }
.dash-card h3 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.015em; }
html[lang="ar"] .dash-card h3 { line-height: 1.5; }
.dash-card p { margin-top: 8px; color: rgba(26, 39, 68, .86); }
.dash-card .eyebrow { align-self: flex-start; }
@media (min-width: 1000px) {
  .dash-grid {
    grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-inline: 0; padding: 0; overflow: visible;
  }
}

/* ── And more ───────────────────────────────────── */
.section { padding: 88px 0 0; }
.cards { display: grid; gap: 16px; margin-top: 44px; }
@media (min-width: 600px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--card); border-radius: var(--r-card); padding: 24px;
  border: 1px solid rgba(26, 39, 68, .05);
}
.card-ic {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px;
  background: var(--gold-light); color: var(--navy);
}
.card-ic svg { width: 22px; height: 22px; }
.card h3 { margin-top: 16px; font-size: 1.12rem; line-height: 1.3; }
.card p { margin-top: 6px; color: var(--muted); font-size: .96rem; }

.hadith {
  margin: 40px 0 0; padding: clamp(28px, 4vw, 44px);
  border-radius: var(--r-card); background: var(--navy); color: #fff;
  text-align: center; position: relative; overflow: hidden;
}
.hadith::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 80% at 50% 0%, rgba(212, 168, 87, .22) 0%, transparent 70%);
}
.hadith-label { position: relative; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.hadith-ar {
  position: relative; margin-top: 14px; font-family: var(--font-ar);
  font-size: clamp(1.3rem, 2.6vw, 1.75rem); line-height: 1.9; color: #fff;
}
.hadith-tr { position: relative; margin: 10px auto 0; max-width: 760px; color: rgba(255, 255, 255, .8); font-size: 1.05rem; font-style: italic; }
.hadith-tr:empty { display: none; }
.hadith-src { position: relative; margin-top: 14px; color: var(--gold-light); font-weight: 600; font-size: .92rem; }

/* ── Download CTA ───────────────────────────────── */
.cta { margin-top: 88px; text-align: center; padding-block: clamp(48px, 7vw, 88px); }
.cta img { width: 64px; height: 64px; border-radius: 16px; margin-inline: auto; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5); }
.cta h2 { margin-top: 20px; color: #fff; font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.1; letter-spacing: -.025em; }
html[lang="ar"] .cta h2 { line-height: 1.4; }
.cta p { margin-top: 12px; color: var(--hero-sub); font-size: 1.15rem; font-weight: 600; }
.cta .stores { justify-content: center; margin-top: 30px; }

/* ── Footer ─────────────────────────────────────── */
.site-footer { margin-top: 88px; background: var(--mesh-1); color: rgba(255, 255, 255, .72); padding: 56px 0 32px; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .brand { color: #fff; }
.footer-tagline { margin-top: 12px; max-width: 340px; font-size: .95rem; }
.footer-title { color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.footer-links { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { text-decoration: none; color: rgba(255, 255, 255, .78); }
.footer-links a:hover { color: var(--gold); }
.site-footer .lang-switch { margin-top: 14px; }
.footer-bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .85rem; color: rgba(255, 255, 255, .55);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
