/* =========================================================
   Hafiz AI — Dark Editorial Design
   Inspired by apple.com: deep blacks, cinematic type,
   generous whitespace, frosted nav, gradient accents.
   Display: Fraunces  ·  Body: Inter
   Quran:   DigitalKhatt IndoPak  ·  Brand: Aref Ruqaa
========================================================= */

@font-face {
  font-family: "DigitalKhatt IndoPak";
  src: url("DigitalKhattIndoPak.otf") format("opentype");
  font-display: swap;
  font-weight: 400;
}

:root {
  /* ── Palette (dark-first) ─────────────────────────────── */
  --bg:      #000000;
  --bg-soft: #0a0a0a;
  --bg-2:    #111111;
  --bg-card: #1d1d1f;
  --ink:     #f5f5f7;
  --ink-2:   #a1a1a6;
  --ink-3:   #6e6e73;
  --ink-4:   #48484a;
  --line:    rgba(255, 255, 255, 0.08);
  --line-2:  rgba(255, 255, 255, 0.04);

  /* ── Accent ─────────────────────────────────────────── */
  --green:      #30d158;
  --green-2:    #28a745;
  --green-3:    rgba(48, 209, 88, 0.12);
  --green-4:    rgba(48, 209, 88, 0.06);
  --green-glow: rgba(48, 209, 88, 0.15);

  /* ── Shadows ────────────────────────────────────────── */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
  --shadow-green: 0 16px 40px rgba(48, 209, 88, 0.25);

  /* ── Radii ──────────────────────────────────────────── */
  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  /* ── Layout ─────────────────────────────────────────── */
  --max:  1120px;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);

  /* ── Type stacks ────────────────────────────────────── */
  --serif: "Fraunces", "Iowan Old Style", "Apple Garamond", "Times New Roman", serif;
  --sans:  "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --quran: "DigitalKhatt IndoPak", "Amiri Quran", "Scheherazade New", serif;
  --kufi:  "Aref Ruqaa", "Reem Kufi", "Amiri", serif;

  /* ── Components ─────────────────────────────────────── */
  --bg-nav:            rgba(0, 0, 0, 0.72);
  --btn-ghost-bg:     rgba(255, 255, 255, 0.12);
  --btn-ghost-border: rgba(255, 255, 255, 0.10);
  --btn-ghost-hover:  rgba(255, 255, 255, 0.18);
}

:root[data-theme="light"] {
  /* ── Palette (light) ────────────────────────────────── */
  --bg:      #ffffff;
  --bg-soft: #f5f7f8;
  --bg-2:    #fdfdfd;
  --bg-card: #f5f5f7;
  --ink:     #1d1d1f;
  --ink-2:   #515154;
  --ink-3:   #86868b;
  --ink-4:   #d2d2d7;
  --line:    rgba(0, 0, 0, 0.08);
  --line-2:  rgba(0, 0, 0, 0.04);

  /* ── Accent (light readable green) ──────────────────── */
  --green:      #1d9a3f;
  --green-2:    #157c30;
  --green-3:    rgba(29, 154, 63, 0.10);
  --green-4:    rgba(29, 154, 63, 0.05);
  --green-glow: rgba(29, 154, 63, 0.12);

  /* ── Shadows (light mode soft shadows) ──────────────── */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.10);
  --shadow-green: 0 16px 40px rgba(29, 154, 63, 0.15);

  /* ── Components (light) ─────────────────────────────── */
  --bg-nav:            rgba(255, 255, 255, 0.78);
  --btn-ghost-bg:     rgba(0, 0, 0, 0.05);
  --btn-ghost-border: rgba(0, 0, 0, 0.08);
  --btn-ghost-hover:  rgba(0, 0, 0, 0.09);
}

/* ── Theme Toggle Button ──────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  color: var(--ink-2);
  padding: 8px;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.2s var(--ease);
}
.theme-toggle:hover {
  background: var(--line-2);
  color: var(--ink);
  transform: scale(1.05);
}
.theme-toggle:active {
  transform: scale(0.95);
}
.theme-toggle .moon-icon { display: none; }
.theme-toggle .sun-icon { display: block; }

[data-theme="light"] .theme-toggle .moon-icon { display: block; }
[data-theme="light"] .theme-toggle .sun-icon { display: none; }


/* ── Reset ────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Utility classes */
.serif { font-family: var(--serif); font-optical-sizing: auto; }
.kufi  { font-family: var(--kufi); }
.quran { font-family: var(--quran); direction: rtl; line-height: 2.1; }

/* =========================================================
   LOGO
========================================================= */
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand .logo { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; }
.brand .logo svg { width: 100%; height: 100%; }
.brand .word { display: flex; align-items: baseline; gap: 9px; }
.brand .word .en { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.brand .word .ar { font-family: var(--kufi); font-size: 23px; color: var(--green); line-height: 1; transform: translateY(2px); }
.brand .sub { font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--ink-3); margin-left: 4px; }

/* =========================================================
   NAV — frosted glass
========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
  font-size: 14px; color: var(--ink-2); font-weight: 400;
  position: relative; padding: 6px 0;
  transition: color 0.25s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 980px;
  background: var(--btn-ghost-bg); color: var(--ink) !important;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--btn-ghost-border);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.3s var(--ease);
}
.nav-cta:hover { background: var(--btn-ghost-hover); transform: translateY(-1px); }

.nav-auth { display: inline-flex; align-items: center; gap: 14px; }
.nav-signin {
  font-size: 14px; color: var(--ink-2); font-weight: 400;
  padding: 6px 4px; position: relative;
  transition: color 0.25s var(--ease);
}
.nav-signin:hover { color: var(--green); }
.nav-signin::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 2px; height: 1px;
  background: var(--green); transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-signin:hover::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }

/* =========================================================
   BUTTONS
========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 28px; border-radius: 980px;
  font-family: var(--sans); font-weight: 500; font-size: 17px; letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease),
              background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn-primary { background: var(--green); color: #000; box-shadow: var(--shadow-green); }
.btn-primary:hover { background: #3ae067; transform: translateY(-2px); box-shadow: 0 20px 50px rgba(48, 209, 88, 0.35); }
.btn-ghost { background: var(--btn-ghost-bg); color: var(--ink); border-color: var(--btn-ghost-border); }
.btn-ghost:hover { background: var(--btn-ghost-hover); transform: translateY(-2px); }
.btn-dark-ghost { background: rgba(255, 255, 255, 0.06); color: #fff !important; border-color: rgba(255, 255, 255, 0.14); }
.btn-dark-ghost:hover { background: rgba(255, 255, 255, 0.10); transform: translateY(-2px); }

.btn-app {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; background: transparent; border: 0; border-radius: 14px;
  line-height: 0;
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}
.btn-app img {
  display: block; height: 56px; width: auto;
  border-radius: 12px;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.4));
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}
.btn-app:hover { transform: translateY(-2px); }
.btn-app:hover img { filter: drop-shadow(0 14px 30px rgba(48, 209, 88, 0.35)); }
.btn-app:active { transform: translateY(0); }

/* =========================================================
   HERO — cinematic, centered energy
========================================================= */
.hero { position: relative; padding: 100px 0 140px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 72px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px; border-radius: 980px;
  background: var(--green-3); color: var(--green);
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid rgba(48, 209, 88, 0.15);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(48, 209, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

h1.hero-title {
  font-family: var(--serif);
  font-size: clamp(52px, 7vw, 96px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 28px 0 24px;
  font-variation-settings: "SOFT" 50, "WONK" 0, "opsz" 96;
}
.hero-title .accent {
  font-style: italic;
  background: linear-gradient(120deg, var(--green) 0%, #34d399 40%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 19px; color: var(--ink-2); max-width: 560px; margin: 0 0 36px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-meta { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 24px; color: var(--ink-3); font-size: 14px; }
.hero-meta .check { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta svg { color: var(--green); flex-shrink: 0; }

.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; top: -300px; right: -200px;
  width: 800px; height: 800px; border-radius: 50%;
  background: radial-gradient(circle, rgba(48, 209, 88, 0.12) 0%, transparent 65%);
  filter: blur(60px); animation: float 18s var(--ease) infinite;
}
.hero-bg::after {
  content: ""; position: absolute; bottom: -300px; left: -200px;
  width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(100, 100, 255, 0.06) 0%, transparent 65%);
  filter: blur(60px); animation: float 22s var(--ease) infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.06); }
}
.grid-pattern {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
}
.hero-calligraphy {
  position: absolute;
  font-family: var(--kufi);
  color: rgba(255, 255, 255, 0.025);
  font-size: 400px; line-height: 1;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none; user-select: none; z-index: -1;
  animation: drift 28s var(--ease) infinite;
}
@keyframes drift {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50% { transform: translate(-48%, -52%) rotate(-1.5deg); }
}

/* =========================================================
   PHONE MOCKUP (legacy — kept for compatibility)
========================================================= */
.phone-wrap { position: relative; display: grid; place-items: center; perspective: 1400px; }
.phone {
  position: relative; width: 310px; height: 632px;
  border-radius: 48px;
  background: linear-gradient(180deg, #1d1d1f 0%, #0a0a0a 100%);
  padding: 12px;
  box-shadow: 0 80px 140px rgba(0, 0, 0, 0.6), 0 24px 50px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: rotate3d(1, -0.3, 0.05, 8deg);
  animation: phoneIn 1.2s var(--ease) both;
}
@keyframes phoneIn {
  from { opacity: 0; transform: translateY(40px) rotate3d(1, -0.3, 0.05, 14deg); }
  to   { opacity: 1; transform: rotate3d(1, -0.3, 0.05, 8deg); }
}
.phone .notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 110px; height: 30px; border-radius: 999px; background: #000; z-index: 2; }
.phone-screen {
  position: relative; width: 100%; height: 100%;
  border-radius: 36px;
  background: linear-gradient(180deg, #1d1d1f 0%, #111 100%);
  overflow: hidden; display: flex; flex-direction: column;
}
.screen-top { padding: 60px 24px 0; display: flex; align-items: center; justify-content: space-between; }
.screen-top .label { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.10em; text-transform: uppercase; }
.screen-top .surah { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.screen-arabic {
  margin: 24px 18px 0; padding: 28px 20px; border-radius: 20px;
  background: var(--bg-card); box-shadow: var(--shadow-md);
  font-family: var(--quran); font-size: 32px; line-height: 2.1;
  text-align: center; color: var(--ink); direction: rtl;
}
.screen-arabic .w { display: inline-block; padding: 0 4px; transition: color 0.4s var(--ease), background 0.4s var(--ease); border-radius: 6px; }
.screen-arabic .w.ok { color: var(--green); }
.screen-arabic .w.live { background: var(--green-3); color: var(--green); animation: wordPulse 1.4s var(--ease) infinite; }
@keyframes wordPulse { 0%, 100% { background: var(--green-3); } 50% { background: rgba(48, 209, 88, 0.20); } }
.screen-waveform { margin: 28px 22px 0; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 3px; }
.screen-waveform span { display: block; width: 4px; border-radius: 4px; background: var(--green); animation: wave 1.4s var(--ease) infinite; }
.screen-waveform span:nth-child(odd) { background: var(--green-2); }
@keyframes wave { 0%, 100% { height: 12%; } 50% { height: 100%; } }
.screen-waveform span:nth-child(1)  { animation-delay: 0.00s; }
.screen-waveform span:nth-child(2)  { animation-delay: 0.08s; }
.screen-waveform span:nth-child(3)  { animation-delay: 0.16s; }
.screen-waveform span:nth-child(4)  { animation-delay: 0.24s; }
.screen-waveform span:nth-child(5)  { animation-delay: 0.32s; }
.screen-waveform span:nth-child(6)  { animation-delay: 0.40s; }
.screen-waveform span:nth-child(7)  { animation-delay: 0.32s; }
.screen-waveform span:nth-child(8)  { animation-delay: 0.24s; }
.screen-waveform span:nth-child(9)  { animation-delay: 0.16s; }
.screen-waveform span:nth-child(10) { animation-delay: 0.08s; }
.screen-waveform span:nth-child(11) { animation-delay: 0.00s; }
.screen-waveform span:nth-child(12) { animation-delay: 0.08s; }
.screen-waveform span:nth-child(13) { animation-delay: 0.16s; }
.screen-waveform span:nth-child(14) { animation-delay: 0.24s; }
.screen-waveform span:nth-child(15) { animation-delay: 0.32s; }
.screen-waveform span:nth-child(16) { animation-delay: 0.40s; }
.screen-waveform span:nth-child(17) { animation-delay: 0.32s; }
.screen-waveform span:nth-child(18) { animation-delay: 0.24s; }
.screen-waveform span:nth-child(19) { animation-delay: 0.16s; }
.screen-waveform span:nth-child(20) { animation-delay: 0.08s; }
.screen-mic {
  margin: auto auto 40px; width: 80px; height: 80px; border-radius: 50%;
  background: var(--green); color: #000; display: grid; place-items: center;
  box-shadow: 0 18px 44px rgba(48, 209, 88, 0.45), inset 0 0 0 6px rgba(255, 255, 255, 0.08);
  position: relative;
}
.screen-mic::before, .screen-mic::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--green); opacity: 0;
  animation: ring 2.2s var(--ease) infinite;
}
.screen-mic::after { animation-delay: 1.1s; }
@keyframes ring { 0% { opacity: 0.6; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.7); } }
.screen-mic svg { width: 32px; height: 32px; }

.float-card {
  position: absolute; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  animation: floatCard 5s var(--ease) infinite; z-index: 3;
}
.float-card .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--green-3); color: var(--green); }
.float-card.fc-1 { top: 80px; left: -36px; animation-delay: 0.4s; }
.float-card.fc-2 { bottom: 110px; right: -40px; animation-delay: 1.2s; }
@keyframes floatCard { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* =========================================================
   SECTION BASE
========================================================= */
section { padding: 140px 0; position: relative; }
.section-head { text-align: center; max-width: 780px; margin: 0 auto 72px; }
.section-tag {
  display: inline-block;
  padding: 6px 14px; border-radius: 980px;
  background: var(--green-4); color: var(--green);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid rgba(48, 209, 88, 0.12);
}
.section-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.025em; line-height: 1.06;
  margin: 20px 0 18px;
  font-variation-settings: "SOFT" 40, "opsz" 96;
}
.section-title em { font-style: italic; color: var(--green); font-weight: 500; }
.section-sub { color: var(--ink-2); font-size: 19px; line-height: 1.6; }

/* =========================================================
   STATS
========================================================= */
.stats { padding: 56px 0; background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat { text-align: center; }
.stat .num {
  font-family: var(--serif); font-size: 52px; font-weight: 500; letter-spacing: -0.025em;
  background: linear-gradient(135deg, #f5f5f7, var(--green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variation-settings: "opsz" 96;
}
.stat .lbl { font-size: 14px; color: var(--ink-3); font-weight: 400; margin-top: 6px; }

/* =========================================================
   FEATURES
========================================================= */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  position: relative; padding: 32px 28px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  overflow: hidden;
}
.feature::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(48, 209, 88, 0.08), transparent 40%);
  opacity: 0; transition: opacity 0.4s var(--ease); pointer-events: none;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(48, 209, 88, 0.20); }
.feature:hover::before { opacity: 1; }
.feature .icn {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--green-3); color: var(--green);
  display: grid; place-items: center; margin-bottom: 20px;
  transition: transform 0.5s var(--ease);
}
.feature:hover .icn { transform: scale(1.08) rotate(-4deg); }
.feature h3 { font-family: var(--serif); font-weight: 600; margin: 0 0 8px; font-size: 20px; letter-spacing: -0.015em; }
.feature p { margin: 0; color: var(--ink-3); font-size: 15px; }

/* =========================================================
   HOW IT WORKS
========================================================= */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 38px; left: 8%; right: 8%; height: 1px;
  background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 16px);
  z-index: 0;
}
.step { position: relative; z-index: 1; text-align: center; padding: 0 14px; }
.step .num {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid rgba(48, 209, 88, 0.25); color: var(--green);
  display: grid; place-items: center; margin: 0 auto 20px;
  font-family: var(--serif); font-weight: 600; font-size: 20px;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.step:hover .num { background: var(--green); color: #000; transform: scale(1.08); }
.step h3 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 0 0 6px; letter-spacing: -0.015em; }
.step p { color: var(--ink-3); font-size: 15px; margin: 0; }

/* =========================================================
   SHOWCASE
========================================================= */
.showcase { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.showcase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.showcase h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(32px, 4vw, 48px); margin: 14px 0 16px; letter-spacing: -0.024em; line-height: 1.06; }
.showcase p { color: var(--ink-2); font-size: 17px; margin: 0 0 28px; }
.showcase-list { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 14px; }
.showcase-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; color: var(--ink-2); }
.showcase-list .tick { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--green-3); color: var(--green); display: grid; place-items: center; margin-top: 2px; }

.showcase-visual { position: relative; min-height: 480px; display: grid; place-items: center; }
.showcase-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px; transform: rotate(-1.5deg);
  transition: transform 0.5s var(--ease);
}
.showcase-card:hover { transform: rotate(0); }
.showcase-card .row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.showcase-card .badge { background: var(--green-3); color: var(--green); padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.showcase-card .ayah { font-family: var(--quran); font-size: 28px; line-height: 2.1; text-align: center; direction: rtl; color: var(--ink); margin: 8px 0 20px; }
.showcase-card .progress { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 10px; }
.showcase-card .progress-bar { height: 100%; background: var(--green); width: 86%; animation: fill 2.6s var(--ease) both; }
@keyframes fill { from { width: 0; } to { width: 86%; } }
.showcase-card .meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.showcase-card .meta strong { color: var(--green); font-weight: 700; }

/* =========================================================
   FAQ
========================================================= */
.faq { max-width: 760px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; padding: 24px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  cursor: pointer;
  font-family: var(--serif); font-weight: 500; font-size: 19px; letter-spacing: -0.01em;
  transition: color 0.2s var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--green); }
.faq-item summary .ic {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-card); color: var(--ink-2);
  display: grid; place-items: center; flex-shrink: 0;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.faq-item[open] summary .ic { transform: rotate(45deg); background: var(--green); color: #000; }
.faq-item .answer { padding: 0 4px 24px; color: var(--ink-2); font-size: 15.5px; animation: fadeDown 0.4s var(--ease); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   CTA BLOCK
========================================================= */
.cta-wrap {
  margin: 0 auto;
  background: linear-gradient(135deg, #1d1d1f 0%, #0a0a0a 100%);
  color: var(--ink); border-radius: var(--radius-xl);
  padding: 80px 56px;
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line);
}
.cta-wrap::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(560px circle at 15% 20%, rgba(48, 209, 88, 0.15), transparent 50%),
    radial-gradient(560px circle at 85% 80%, rgba(100, 100, 255, 0.08), transparent 55%);
  pointer-events: none;
}
.cta-wrap::after {
  content: "حافظ"; position: absolute;
  font-family: var(--kufi); font-size: 360px; line-height: 1;
  right: -40px; bottom: -120px;
  color: rgba(255, 255, 255, 0.02); pointer-events: none; user-select: none;
}
.cta-wrap h2 { position: relative; font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 4vw, 50px); margin: 0 0 16px; letter-spacing: -0.024em; line-height: 1.06; }
.cta-wrap p { position: relative; color: var(--ink-2); font-size: 17px; max-width: 580px; margin: 0 auto 32px; }
.cta-actions { position: relative; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* =========================================================
   FOOTER
========================================================= */
.footer { padding: 72px 0 36px; border-top: 1px solid var(--line); background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 44px; }
.footer h4 { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer a { color: var(--ink-3); font-size: 14px; transition: color 0.2s var(--ease); }
.footer a:hover { color: var(--green); }
.footer-about p { color: var(--ink-3); font-size: 14px; margin: 14px 0 0; max-width: 320px; line-height: 1.55; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; border-top: 1px solid var(--line); color: var(--ink-4); font-size: 13px; }

/* =========================================================
   REVEAL ANIMATIONS
========================================================= */
.reveal { 
  opacity: 0; 
  transform: translateY(40px) scale(0.96); 
  filter: blur(8px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              filter 1.2s cubic-bezier(0.16, 1, 0.3, 1); 
  will-change: opacity, transform, filter;
}
.reveal.is-visible { 
  opacity: 1; 
  transform: translateY(0) scale(1); 
  filter: blur(0);
}
.reveal.delay-1 { transition-delay: 0.12s; }
.reveal.delay-2 { transition-delay: 0.24s; }
.reveal.delay-3 { transition-delay: 0.36s; }
.reveal.delay-4 { transition-delay: 0.48s; }

.fade-words .word {
  display: inline-block; opacity: 0; transform: translateY(20px);
  animation: wordIn 0.9s var(--ease) forwards;
}
@keyframes wordIn { to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   LEGAL PAGES
========================================================= */
.legal-hero {
  position: relative; padding: 96px 0 64px;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line); overflow: hidden;
}
.legal-hero::before {
  content: ""; position: absolute; top: -180px; right: -120px;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, var(--green-glow) 0%, transparent 65%);
  filter: blur(40px); pointer-events: none; animation: float 16s var(--ease) infinite;
}
.legal-hero::after {
  content: "حافظ"; position: absolute;
  font-family: var(--kufi); font-size: 280px; line-height: 1;
  right: 4%; bottom: -90px; color: var(--line-2);
  pointer-events: none; user-select: none;
}
.legal-hero .crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-3); margin-bottom: 18px;
}
.legal-hero .crumb a { color: var(--ink-3); transition: color 0.2s var(--ease); }
.legal-hero .crumb a:hover { color: var(--green); }
.legal-hero .crumb svg { color: var(--ink-4); }
.legal-hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(42px, 5.4vw, 68px); letter-spacing: -0.026em; line-height: 1.05;
  margin: 0 0 14px; font-variation-settings: "SOFT" 40, "opsz" 96;
}
.legal-hero h1 em { font-style: italic; color: var(--green); }
.legal-hero .lead { color: var(--ink-2); font-size: 17px; max-width: 620px; margin: 0; line-height: 1.6; }
.legal-hero .updated {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px; padding: 7px 14px; border-radius: 980px;
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-sm);
}
.legal-hero .updated .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2s var(--ease) infinite; }

.legal { padding: 72px 0 96px; }
.legal-grid { display: grid; grid-template-columns: 260px 1fr; gap: 64px; align-items: start; }
.legal-toc {
  position: sticky; top: 72px; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card); box-shadow: var(--shadow-sm);
}
.legal-toc h4 { font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 14px; }
.legal-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; display: grid; gap: 4px; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex; gap: 12px; align-items: baseline; padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: var(--ink-2); font-weight: 500;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--serif); font-style: italic;
  font-size: 11.5px; color: var(--ink-4); font-feature-settings: "tnum"; min-width: 22px;
}
.legal-toc a:hover { background: var(--green-4); color: var(--green); }
.legal-toc a.active { background: var(--green-3); color: var(--green); font-weight: 600; }
.legal-toc a.active::before { color: var(--green); }

.legal-content { max-width: 760px; }
.legal-content section { padding: 0; margin-bottom: 48px; scroll-margin-top: 100px; }
.legal-content section:last-child { margin-bottom: 0; }
.legal-content .sec-num {
  font-family: var(--serif); font-style: italic;
  font-size: 14px; color: var(--green); font-weight: 500;
  letter-spacing: 0.04em; display: inline-block; margin-bottom: 8px;
}
.legal-content h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: 30px; letter-spacing: -0.020em; line-height: 1.15; margin: 0 0 16px;
}
.legal-content p, .legal-content li { color: var(--ink-2); font-size: 16px; line-height: 1.78; }
.legal-content p { margin: 0 0 14px; }
.legal-content ul { padding-left: 22px; margin: 0 0 14px; }
.legal-content ul li { margin-bottom: 6px; }
.legal-content ul li::marker { color: var(--green); }
.legal-content a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.legal-content strong { color: var(--ink); font-weight: 600; }

.legal-foot {
  margin-top: 64px; padding: 32px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.legal-foot .ft-text { color: var(--ink-2); font-size: 15px; max-width: 460px; }
.legal-foot .ft-text strong { display: block; font-family: var(--serif); font-size: 18px; margin-bottom: 4px; color: var(--ink); }
.legal-foot a.btn { padding: 11px 18px; font-size: 14px; }

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 960px) {
  .hero { padding: 60px 0 100px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .phone { transform: none; animation: phoneInFlat 1s var(--ease) both; }
  @keyframes phoneInFlat { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
  .features-grid, .steps, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .steps::before { display: none; }
  .showcase-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-toc { position: relative; top: 0; }
}
@media (max-width: 620px) {
  .nav-inner { height: 48px; }
  .brand .logo { width: 32px; height: 32px; }
  .brand .word .en { font-size: 16px; }
  .brand .word .ar { font-size: 19px; }
  
  /* Mobile Nav Fixes */
  .desktop-only { display: none !important; }
  .mobile-only-nav { 
    display: flex !important; 
    flex-direction: column; 
    gap: 14px; 
    margin-top: 8px; 
    padding-top: 18px; 
    border-top: 1px solid var(--line);
  }
  .mobile-only-nav .nav-signin { width: max-content; padding: 6px 0; }
  .mobile-only-nav .nav-cta { width: max-content; justify-content: flex-start; }

  /* Hero Fixes */
  .hero { padding: 40px 0 80px; }
  .hero-title { font-size: clamp(34px, 10.5vw, 96px); text-align: center; margin-top: 16px; }
  .hero-sub { text-align: center; margin: 0 auto 32px; font-size: 17px; }
  .hero-actions { justify-content: center; }
  .hero-meta { justify-content: center; }
  .eyebrow { display: flex; margin: 0 auto; width: max-content; }
  
  .section-title { font-size: clamp(32px, 9vw, 64px); }
  .stat .num { font-size: clamp(36px, 11vw, 52px); }
  .feature .icn { width: 44px; height: 44px; margin-bottom: 16px; }
  .showcase-card { padding: 22px; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open .nav-links {
    display: flex; flex-direction: column;
    position: absolute; top: 48px; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.92); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    padding: 18px 24px; gap: 18px;
    animation: fadeDown 0.3s var(--ease);
  }
  section { padding: 80px 0; }
  .features-grid, .steps, .stats-grid { grid-template-columns: 1fr; }
  .cta-wrap { padding: 52px 24px; border-radius: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .hero-calligraphy { font-size: 240px; }
}

/* =========================================================
   SCROLL MOTION UTILITIES (Apple-style, JS-driven)
   These are initial states. motion.js animates them
   continuously based on scroll progress.
========================================================= */
[data-motion="scale-reveal"] {
  opacity: 0;
  transform: scale(0.88);
  filter: blur(10px);
  will-change: opacity, transform, filter;
}
[data-motion="fade-up"] {
  opacity: 0;
  transform: translateY(50px);
  filter: blur(6px);
  will-change: opacity, transform, filter;
}
[data-motion="zoom-headline"] {
  opacity: 0;
  transform: translateY(40px) scale(0.75);
  will-change: opacity, transform;
}
[data-motion="parallax"] {
  will-change: transform;
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .fade-words .word { opacity: 1; transform: none; }
}
