/* ============================================================
   AL-FALAH ACADEMY — COMPLETE DESIGN SYSTEM
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700;900&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,700&display=swap');

/* ── Design Tokens (Light Mode) ────────────────────────────── */
:root {
  --green-950: #071a0e;
  --green-900: #0d2b1a;
  --green-800: #1a472a;
  --green-700: #2d6a4f;
  --green-600: #40916c;
  --green-500: #52b788;
  --green-200: #95d5b2;
  --green-100: #d8f3dc;
  --gold-700:  #9a7b2f;
  --gold-600:  #b8942e;
  --gold-500:  #c9a84c;
  --gold-400:  #d4b96e;
  --gold-300:  #e0cc96;
  --gold-200:  #f0dfa0;
  --gold-100:  #faf3d8;
  --cream:     #faf8f2;
  --warm-white:#fff9f0;
  --gray-900:  #111827;
  --gray-800:  #1f2937;
  --gray-700:  #374151;
  --gray-500:  #6b7280;
  --gray-400:  #9ca3af;
  --gray-300:  #d1d5db;
  --gray-100:  #f3f4f6;
  --border:    #e8e0d0;

  /* Cards */
  --card-bg:   #ffffff;
  --card-border: var(--border);

  --radius-sm:   6px;
  --radius-md:   14px;
  --radius-lg:   24px;
  --radius-full: 9999px;

  --shadow-sm:   0 1px 4px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 12px 36px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl:   0 24px 60px rgba(0,0,0,.13);
  --shadow-gold: 0 8px 30px rgba(201,168,76,.30);

  --ease:       cubic-bezier(.4, 0, .2, 1);
  --ease-spring:cubic-bezier(.34,1.56,.64,1);
  --transition: all .3s var(--ease);

  --font-heading: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --font-arabic:  'Noto Naskh Arabic', 'Amiri', 'Traditional Arabic', serif;

  --nav-height: 74px;
}

/* Al-Falah editorial homepage */
.navbar {
  padding: 0 max(2rem, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.navbar-brand { letter-spacing: -.02em; }
.brand-copy { display: flex; align-items: baseline; gap: .3rem; }
.brand-copy small, .footer-logo small { font: 500 .68rem var(--font-body); letter-spacing: .13em; text-transform: uppercase; opacity: .67; }
.nav-link { font-size: .75rem; letter-spacing: .09em; }
.btn-donate { display: inline-flex; align-items: center; gap: .7rem; }

.home-hero {
  position: relative;
  min-height: 800px;
  height: min(920px, 100svh);
  overflow: hidden;
  color: #fff;
  background: #061e16;
}
.home-hero-image, .home-hero-shade, .home-hero-ornament { position: absolute; inset: 0; }
.home-hero-image {
  background: url('/images/quran-banner.jpg') 66% center / cover no-repeat;
  transform: scale(1.04);
  opacity: .78;
}
.home-hero-shade {
  background:
    linear-gradient(90deg, rgba(4,24,17,.98) 0%, rgba(5,29,20,.94) 42%, rgba(7,35,24,.52) 72%, rgba(5,25,17,.3) 100%),
    linear-gradient(0deg, rgba(4,20,14,.92) 0%, transparent 30%);
}
.home-hero-ornament {
  left: auto;
  width: 47%;
  border-left: 1px solid rgba(222,191,111,.18);
  background:
    radial-gradient(circle at 80% 25%, rgba(219,188,108,.16), transparent 35%),
    repeating-linear-gradient(45deg, transparent 0 28px, rgba(255,255,255,.018) 28px 29px);
}
.home-hero-inner {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  align-items: center;
  gap: 7vw;
  padding-top: 8rem;
  padding-bottom: 7rem;
}
.home-hero-copy { max-width: 720px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.72);
  margin-bottom: 1.25rem;
}
.eyebrow > span { width: 34px; height: 1px; background: var(--gold-400); }
.eyebrow.dark { color: var(--green-700); }
.eyebrow.gold { color: var(--gold-300); }
.eyebrow.centered { justify-content: center; }
.home-hero h1 {
  color: #fff;
  font-size: clamp(3.5rem, 7.4vw, 7rem);
  line-height: .97;
  letter-spacing: -.055em;
  font-weight: 400;
}
.home-hero h1 em { color: var(--gold-300); font-weight: 400; }
.home-hero-lead {
  max-width: 590px;
  margin-top: 2rem;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
  line-height: 1.75;
  color: rgba(255,255,255,.72);
}
.home-hero-actions { display: flex; align-items: center; gap: 2.2rem; margin-top: 2.4rem; }
.text-link-light, .text-link-dark {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  font-size: .86rem;
  font-weight: 700;
}
.text-link-light { color: #fff; }
.text-link-dark { color: var(--green-700); }
.text-link-light:hover, .text-link-dark:hover { color: var(--gold-500); }
.play-disc {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
}
.hero-trust { display: flex; align-items: center; gap: 1rem; margin-top: 3.2rem; }
.hero-trust p { color: rgba(255,255,255,.55); font-size: .78rem; line-height: 1.55; }
.hero-trust strong { color: rgba(255,255,255,.9); font-weight: 600; }
.avatar-stack { display: flex; }
.avatar-stack span {
  width: 35px; height: 35px; margin-right: -8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #0a2a1e; border-radius: 50%;
  background: #d2bd7f; color: #133d2b;
  font: 700 1rem var(--font-arabic);
}
.hero-verse-card {
  justify-self: end;
  width: min(100%, 390px);
  padding: 2.8rem 2.4rem 2rem;
  border: 1px solid rgba(226,203,145,.3);
  background: linear-gradient(145deg, rgba(9,46,33,.76), rgba(4,25,17,.68));
  backdrop-filter: blur(18px);
  box-shadow: 0 35px 80px rgba(0,0,0,.3);
}
.verse-card-mark { color: var(--gold-400); font-size: 1.35rem; text-align: center; }
.hero-arabic {
  color: #fff;
  font: 400 clamp(2rem, 3.5vw, 3.15rem)/1.9 var(--font-arabic);
  text-align: center;
  margin: 1.2rem 0 .7rem;
}
.hero-verse-translation { color: rgba(255,255,255,.78); font: italic 1.12rem/1.6 var(--font-heading); text-align: center; }
.hero-verse-reference { display: flex; justify-content: space-between; margin-top: 1.7rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.14); color: var(--gold-300); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.hero-discover {
  position: absolute; z-index: 3; bottom: 1.9rem; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .65rem;
  color: rgba(255,255,255,.5); font-size: .65rem; letter-spacing: .15em; text-transform: uppercase;
}

.trust-ribbon { background: #f0eadb; border-bottom: 1px solid #ded5c0; }
.trust-ribbon-grid { min-height: 92px; display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; }
.trust-ribbon-grid div { display: flex; align-items: center; justify-content: center; gap: .8rem; border-right: 1px solid #d8cfbb; color: var(--green-800); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }
.trust-ribbon-grid div:last-child { border: 0; }
.trust-ribbon-grid i { color: var(--gold-700); font-size: 1rem; }

.pathways-section { padding: 8rem 0; background: #fbfaf5; }
.split-section-heading { display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; gap: 8rem; margin-bottom: 4rem; }
.split-section-heading h2, .verse-feature-copy h2, .daily-reminder-inner h2, .library-intro h2, .community-cta h2 { font-size: clamp(2.7rem, 5vw, 4.7rem); line-height: 1.03; letter-spacing: -.04em; font-weight: 400; }
.split-section-heading p { max-width: 470px; font-size: 1.02rem; line-height: 1.8; }
.pathways-grid { display: grid; grid-template-columns: 1.45fr 1fr 1fr; gap: 1.25rem; }
.pathway-card {
  position: relative;
  min-height: 470px;
  padding: 2.1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #fff;
  border: 1px solid #e4ddce;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.pathway-card:hover { transform: translateY(-8px); box-shadow: 0 24px 60px rgba(19,46,31,.12); border-color: transparent; }
.pathway-featured { padding: 0; }
.pathway-media { position: relative; height: 100%; min-height: 470px; }
.pathway-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(3,25,17,.96), rgba(3,25,17,.04) 72%); }
.pathway-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.pathway-featured:hover img { transform: scale(1.04); }
.pathway-featured .pathway-content { position: absolute; inset: auto 2.2rem 2.2rem; z-index: 1; }
.pathway-number { position: absolute; top: 1.5rem; right: 1.6rem; font-size: .65rem; letter-spacing: .15em; color: var(--gray-400); z-index: 2; }
.pathway-icon { width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; margin-bottom: auto; border: 1px solid #d9cda9; border-radius: 50%; color: var(--green-700); font-size: 1.2rem; }
.pathway-kicker, .course-index { display: block; color: var(--gold-700); font-size: .68rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; margin-bottom: .65rem; }
.pathway-card h3 { font-size: 2rem; font-weight: 400; }
.pathway-card p { margin-top: .8rem; font-size: .9rem; line-height: 1.7; }
.pathway-link { display: inline-flex; align-items: center; gap: .7rem; margin-top: 1.8rem; color: var(--green-700); font-size: .78rem; font-weight: 700; }
.pathway-featured h3 { color: #fff; font-size: 2.7rem; }
.pathway-featured p { color: rgba(255,255,255,.66); max-width: 500px; }
.pathway-featured .pathway-kicker, .pathway-featured .pathway-link, .pathway-featured .pathway-number { color: var(--gold-300); }

.section-ink { background: var(--green-950); overflow: hidden; padding: 7rem 0; }
.verse-feature-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 8vw; align-items: center; }
.verse-feature-art { min-height: 520px; position: relative; display: flex; align-items: center; justify-content: center; }
.verse-feature-ring { position: absolute; width: 410px; height: 410px; border-radius: 50%; border: 1px solid rgba(210,180,100,.35); box-shadow: 0 0 0 55px rgba(210,180,100,.04), 0 0 0 110px rgba(210,180,100,.025); }
.verse-feature-ring::before, .verse-feature-ring::after { content: ''; position: absolute; inset: 22%; border: 1px solid rgba(210,180,100,.18); transform: rotate(45deg); }
.verse-feature-ring::after { transform: rotate(22.5deg); }
.verse-feature-arabic { position: relative; color: var(--gold-300); font: 400 clamp(6rem, 12vw, 10rem) var(--font-arabic); }
.verse-feature-copy h2, .daily-reminder-inner h2 { color: #fff; }
.verse-feature-copy > p { margin-top: 1.5rem; color: rgba(255,255,255,.6); font-size: 1rem; max-width: 620px; }
.principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 2.8rem 0; border-top: 1px solid rgba(255,255,255,.12); border-bottom: 1px solid rgba(255,255,255,.12); }
.principles-grid div { padding: 1.5rem 1.3rem 1.5rem 0; border-right: 1px solid rgba(255,255,255,.12); }
.principles-grid div:not(:first-child) { padding-left: 1.3rem; }
.principles-grid div:last-child { border: 0; }
.principles-grid span { color: var(--gold-400); font-size: .68rem; }
.principles-grid h3 { margin: .55rem 0; color: #fff; font: 600 1rem var(--font-body); }
.principles-grid p { color: rgba(255,255,255,.45); font-size: .75rem; line-height: 1.6; }

.learning-section { background: #f8f4e9; padding: 8rem 0; }
.editorial-course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.editorial-course-image { display: block; position: relative; height: 300px; overflow: hidden; background: var(--green-900); }
.editorial-course-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,28,19,.45), transparent 60%); }
.editorial-course-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .65s ease; }
.editorial-course:hover img { transform: scale(1.045); }
.editorial-course-image > span { position: absolute; z-index: 1; left: 1rem; bottom: 1rem; padding: .4rem .8rem; background: rgba(248,244,233,.92); color: var(--green-900); font-size: .67rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.editorial-course-body { padding-top: 1.6rem; }
.editorial-course h3 { font-size: 1.7rem; font-weight: 400; }
.editorial-course-body > p:not(.course-index) { margin: .75rem 0 1.1rem; font-size: .9rem; line-height: 1.75; }
.editorial-course-body > a { color: var(--green-700); font-size: .78rem; font-weight: 700; }
.editorial-course-body > a i { margin-left: .5rem; font-size: .7rem; }

.daily-reminder-section { position: relative; overflow: hidden; padding: 7rem 0; color: #fff; background: #143b2b; }
.daily-reminder-pattern { position: absolute; inset: 0; opacity: .12; background: repeating-linear-gradient(60deg, transparent 0 36px, var(--gold-300) 36px 37px, transparent 37px 72px), repeating-linear-gradient(-60deg, transparent 0 36px, var(--gold-300) 36px 37px, transparent 37px 72px); }
.daily-reminder-inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 9vw; align-items: center; }
.daily-reminder-inner blockquote { padding-left: 3rem; border-left: 1px solid rgba(255,255,255,.22); }
.daily-reminder-inner blockquote p { color: var(--gold-200); font: italic clamp(1.6rem, 3vw, 2.5rem)/1.35 var(--font-heading); }
.daily-reminder-inner cite { display: block; margin: 1.2rem 0 2rem; color: rgba(255,255,255,.55); font: normal .72rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; }

.library-section { background: #fffdf8; padding: 8rem 0; }
.library-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 8vw; }
.library-intro h2 { margin-bottom: 1.5rem; }
.library-intro > p { max-width: 480px; margin-bottom: 1.7rem; }
.library-links { border-top: 1px solid var(--border); }
.library-links > a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem; padding: 1.5rem .25rem; border-bottom: 1px solid var(--border); transition: padding .3s ease, background .3s ease; }
.library-links > a:hover { padding-left: 1rem; padding-right: 1rem; background: #f8f4e9; }
.library-icon { width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #efe5c8; color: var(--green-700); }
.library-links small, .library-links strong { display: block; }
.library-links small { color: var(--gray-500); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .3rem; }
.library-links strong { color: var(--green-800); font: 400 1.3rem var(--font-heading); }
.library-links > a > i { color: var(--gold-700); }

.community-cta { position: relative; padding: 6rem 0; background: #08281c; color: #fff; overflow: hidden; }
.community-cta-inner { display: grid; grid-template-columns: .65fr 1.35fr auto; align-items: center; gap: 5vw; }
.community-cta-mark { color: rgba(218,190,116,.17); font: 400 clamp(3rem, 6vw, 5.8rem) var(--font-arabic); transform: rotate(-8deg); }
.community-cta h2 { color: #fff; font-size: clamp(2.5rem, 4.5vw, 4rem); }
.community-cta p { margin-top: 1rem; color: rgba(255,255,255,.55); max-width: 600px; }

.footer { background: #041b12; }
.footer-logo { font-family: var(--font-heading); font-size: 1.35rem; }
.footer-logo > span { display: flex; align-items: baseline; gap: .35rem; }
.footer-start { display: inline-flex; align-items: center; gap: .7rem; margin-top: 1.3rem; color: var(--gold-300); font-size: .76rem; font-weight: 700; }
.footer-address { display: flex; align-items: center; gap: .25rem; color: rgba(255,255,255,.42); font-size: .83rem; line-height: 1.55; }
.footer-blessing { color: var(--gold-300); font: 1.2rem var(--font-arabic) !important; }

@media (max-width: 1000px) {
  .home-hero { height: auto; min-height: 820px; }
  .home-hero-inner { grid-template-columns: 1fr; padding-top: 10rem; }
  .hero-verse-card { display: none; }
  .home-hero-copy { max-width: 760px; }
  .home-hero-ornament { width: 35%; }
  .pathways-grid { grid-template-columns: 1fr 1fr; }
  .pathway-featured { grid-column: 1 / -1; }
  .verse-feature-grid { gap: 3rem; }
  .verse-feature-ring { width: 300px; height: 300px; }
  .editorial-course-image { height: 240px; }
  .community-cta-inner { grid-template-columns: 1fr auto; }
  .community-cta-mark { display: none; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .brand-copy small { display: none; }
  .nav-actions .btn-donate { display: none; }
  .home-hero { min-height: 760px; }
  .home-hero-inner { padding: 9rem 1.4rem 7rem; }
  .home-hero h1 { font-size: clamp(3.3rem, 15vw, 5rem); }
  .home-hero-actions { align-items: flex-start; flex-direction: column; gap: 1.4rem; }
  .home-hero-lead { font-size: 1rem; }
  .trust-ribbon-grid { grid-template-columns: 1fr 1fr; padding: 1rem 0; gap: 1rem 0; }
  .trust-ribbon-grid div:nth-child(2) { border: 0; }
  .trust-ribbon-grid div { font-size: .68rem; }
  .pathways-section, .learning-section, .library-section, .section-ink, .daily-reminder-section { padding: 5rem 0; }
  .split-section-heading { grid-template-columns: 1fr; gap: 1.3rem; margin-bottom: 2.5rem; }
  .pathways-grid, .editorial-course-grid, .daily-reminder-inner, .library-grid, .verse-feature-grid { grid-template-columns: 1fr; }
  .pathway-card { min-height: 390px; }
  .pathway-featured { min-height: 470px; }
  .pathway-media { min-height: 470px; }
  .verse-feature-art { min-height: 360px; }
  .verse-feature-ring { width: 260px; height: 260px; }
  .verse-feature-copy { position: relative; }
  .principles-grid { grid-template-columns: 1fr; }
  .principles-grid div, .principles-grid div:not(:first-child) { padding: 1rem 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .editorial-course-grid { gap: 3rem; }
  .editorial-course-image { height: 300px; }
  .daily-reminder-inner { gap: 2.5rem; }
  .daily-reminder-inner blockquote { padding: 1.8rem 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.2); }
  .library-grid { gap: 3rem; }
  .community-cta-inner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Dark Mode Overrides ───────────────────────────────────── */
[data-theme="dark"] {
  --cream:      #0c1810;
  --warm-white: #0f1f14;
  --card-bg:    #152318;
  --card-border:rgba(255,255,255,.07);
  --border:     rgba(255,255,255,.09);
  --gray-900:   #f0f4f0;
  --gray-700:   #d4ddd6;
  --gray-500:   #8fa897;
  --gray-400:   #6b8a75;
  --gray-300:   rgba(255,255,255,.12);
  --gray-100:   #1a2e1f;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 { color: #e8f5ec; }

[data-theme="dark"] .section-heading { color: #c8e6d0; }

[data-theme="dark"] .feature-card,
[data-theme="dark"] .course-card,
[data-theme="dark"] .reminder-card,
[data-theme="dark"] .quran-card,
[data-theme="dark"] .result-card,
[data-theme="dark"] .event-card,
[data-theme="dark"] .scholar-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .content-box {
  background: var(--card-bg);
  border-color: var(--card-border);
}

[data-theme="dark"] .section-alt { background: #0f1f14; }
[data-theme="dark"] body { background: var(--cream); }

[data-theme="dark"] .mission-strip { background: #0d2018; }
[data-theme="dark"] .mission-icon  { background: rgba(201,168,76,.12); }

[data-theme="dark"] .form-input {
  background: #0f1f14;
  border-color: rgba(255,255,255,.12);
  color: #d4ddd6;
}
[data-theme="dark"] .form-input:focus { background: #152318; }

[data-theme="dark"] .testimonial-card { background: #152318; }
[data-theme="dark"] .nav-link { color: rgba(255,255,255,.75); }

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--gray-700);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Custom Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--green-950); }
::-webkit-scrollbar-thumb { background: var(--gold-500); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-400); }

/* ── Reading Progress Bar ──────────────────────────────────── */
#readingProgress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-500), var(--green-500));
  z-index: 2000;
  transition: width .1s linear;
}

/* ── Preloader ─────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--green-950);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  transition: opacity .5s var(--ease), visibility .5s;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-icon {
  font-family: var(--font-arabic);
  font-size: 3rem;
  color: var(--gold-400);
  animation: preloaderPulse 1.5s ease-in-out infinite;
}

.preloader-text {
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
}

.preloader-bar {
  width: 160px;
  height: 2px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}

.preloader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-500), var(--green-500));
  border-radius: 2px;
  animation: preloaderLoad 1.2s var(--ease) forwards;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--green-800);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.35rem); }
p  { font-size: 1rem; color: var(--gray-500); }

.text-arabic {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 1.4rem;
  line-height: 2.2;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: .5rem;
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}

.navbar.scrolled {
  background: rgba(7, 25, 14, .95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 28px rgba(0,0,0,.4);
}

.navbar.solid {
  background: var(--green-900);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  color: var(--green-900);
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(201,168,76,.4);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: .05rem;
  margin-left: auto;
}

.nav-link {
  color: rgba(255,255,255,.82);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .42rem .72rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: .72rem; right: .72rem;
  height: 2px;
  background: var(--gold-500);
  transform: scaleX(0);
  transition: transform .3s var(--ease);
  border-radius: 2px;
}

.nav-link:hover         { color: #fff; }
.nav-link:hover::after  { transform: scaleX(1); }
.nav-link.active        { color: var(--gold-400); }
.nav-link.active::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: .75rem;
  flex-shrink: 0;
}

.dark-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  cursor: pointer;
}

.dark-toggle:hover {
  background: rgba(255,255,255,.2);
  color: var(--gold-400);
}

.btn-donate {
  padding: .42rem 1.1rem;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--green-900);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  transition: var(--transition);
  box-shadow: 0 3px 12px rgba(201,168,76,.35);
  white-space: nowrap;
}

.btn-donate:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.hamburger {
  display: none;
  margin-left: .5rem;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 1080px) {
  .hamburger { display: flex; }

  .navbar-nav {
    position: fixed;
    top: var(--nav-height); left: 0; right: 0;
    background: rgba(7,25,14,.98);
    backdrop-filter: blur(24px);
    flex-direction: column;
    padding: 1.5rem;
    gap: .4rem;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .4s var(--ease), opacity .3s var(--ease);
    border-bottom: 1px solid rgba(255,255,255,.07);
  }

  .navbar-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: .75rem 1rem;
    font-size: .9rem;
    border-radius: var(--radius-md);
  }
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding-top: var(--nav-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('/images/quran-banner.jpg') center / cover no-repeat;
  transform: scale(1.08);
  transition: transform 8s ease-out;
}

.hero-bg.loaded { transform: scale(1); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(5, 18, 10, .90) 0%,
    rgba(13, 43, 26, .80) 50%,
    rgba(5, 18, 10, .94) 100%
  );
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(60deg,  rgba(201,168,76,.05) 0, rgba(201,168,76,.05) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(-60deg, rgba(201,168,76,.05) 0, rgba(201,168,76,.05) 1px, transparent 1px, transparent 48px),
    repeating-linear-gradient(0deg,   rgba(201,168,76,.03) 0, rgba(201,168,76,.03) 1px, transparent 1px, transparent 48px);
}

/* Floating particles */
.hero-particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.hero-particles span {
  position: absolute;
  border-radius: 50%;
  background: rgba(201,168,76,.15);
  animation: particleFloat linear infinite;
}

.hero-particles span:nth-child(1)  { width:6px;height:6px;left:15%;animation-duration:12s;animation-delay:0s;top:20%; }
.hero-particles span:nth-child(2)  { width:4px;height:4px;left:30%;animation-duration:16s;animation-delay:2s;top:70%; }
.hero-particles span:nth-child(3)  { width:8px;height:8px;left:55%;animation-duration:14s;animation-delay:1s;top:40%; }
.hero-particles span:nth-child(4)  { width:5px;height:5px;left:75%;animation-duration:18s;animation-delay:3s;top:60%; }
.hero-particles span:nth-child(5)  { width:3px;height:3px;left:85%;animation-duration:10s;animation-delay:0s;top:25%; }
.hero-particles span:nth-child(6)  { width:7px;height:7px;left:40%;animation-duration:15s;animation-delay:4s;top:80%; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  padding: 2rem;
  animation: fadeUp .9s var(--ease) both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(201,168,76,.13);
  border: 1px solid rgba(201,168,76,.32);
  color: var(--gold-300);
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .42rem 1.15rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(6px);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.0;
  margin-bottom: 1.25rem;
  text-shadow: 0 4px 30px rgba(0,0,0,.4);
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.hero-verse {
  font-size: clamp(.95rem, 2vw, 1.1rem);
  color: rgba(255,255,255,.85);
  line-height: 1.9;
  margin: 1.75rem auto;
  padding: 1.5rem 2rem;
  border-left: 3px solid var(--gold-500);
  border-right: 3px solid var(--gold-500);
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
  max-width: 660px;
  font-style: italic;
}

.hero-verse .arabic-line {
  font-family: var(--font-arabic);
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-style: normal;
  color: var(--gold-200);
  display: block;
  margin-bottom: .6rem;
  direction: rtl;
  line-height: 2;
}

.hero-verse small {
  display: block;
  font-size: .8rem;
  color: var(--gold-400);
  margin-top: .5rem;
  font-style: normal;
  letter-spacing: .05em;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.25rem;
}

.hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  color: rgba(255,255,255,.85);
}

.hero-stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-400);
  line-height: 1;
  display: block;
}

.hero-stat-label {
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: .3rem;
  opacity: .7;
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.4);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: scrollBounce 2.5s infinite;
}

.hero-scroll .scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,.5), transparent);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .82rem 2.1rem;
  border-radius: var(--radius-full);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .03em;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: translateX(-100%);
  transition: transform .6s ease;
}

.btn:hover::after { transform: translateX(100%); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-700) 100%);
  color: var(--green-900);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 42px rgba(201,168,76,.42);
}

.btn-outline {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-color: rgba(255,255,255,.35);
  backdrop-filter: blur(6px);
}

.btn-outline:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.65);
  transform: translateY(-3px);
}

.btn-green {
  background: var(--green-700);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-green:hover {
  background: var(--green-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-ghost {
  background: transparent;
  color: var(--green-700);
  border-color: var(--green-700);
}

.btn-ghost:hover {
  background: var(--green-700);
  color: #fff;
  transform: translateY(-2px);
}

.btn-sm { padding: .52rem 1.35rem; font-size: .84rem; }
.btn-lg { padding: 1rem 2.6rem; font-size: 1.05rem; }

/* ── Layout ────────────────────────────────────────────────── */
.section     { padding: 6rem 0; }
.section-alt { background: var(--warm-white); }

.container    { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 820px;  margin: 0 auto; padding: 0 2rem; }

/* ── Section Header ────────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--gold-700);
  font-size: .77rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  margin-bottom: .65rem;
}

.section-label::before,
.section-label::after {
  content: '';
  height: 1px;
  width: 26px;
  background: var(--gold-500);
  display: block;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.75rem);
  color: var(--green-800);
  margin-bottom: .65rem;
  line-height: 1.2;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--gray-500);
  max-width: 520px;
  line-height: 1.75;
}

.section-header-centered {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-header-centered .section-label { justify-content: center; }
.section-header-centered .section-sub   { margin: 0 auto; }

/* ── Mission Strip ─────────────────────────────────────────── */
.mission-strip {
  background: var(--green-900);
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}

.mission-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(201,168,76,.04) 0, rgba(201,168,76,.04) 1px, transparent 1px, transparent 50px);
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}

.mission-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  border-right: 1px solid rgba(255,255,255,.08);
  transition: var(--transition);
}

.mission-item:last-child { border-right: none; }

.mission-item:hover { background: rgba(255,255,255,.03); }

.mission-icon {
  width: 56px; height: 56px;
  flex-shrink: 0;
  background: rgba(201,168,76,.12);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 1px solid rgba(201,168,76,.2);
}

.mission-text h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #fff;
  margin-bottom: .25rem;
}

.mission-text p {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  line-height: 1.5;
}

/* ── Stats Section ─────────────────────────────────────────── */
.stats-section { padding: 5rem 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item { text-align: center; }

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--green-700);
  display: block;
  line-height: 1;
  margin-bottom: .4rem;
}

.stat-suffix {
  color: var(--gold-500);
}

.stat-label {
  font-size: .87rem;
  color: var(--gray-500);
  font-weight: 600;
  letter-spacing: .04em;
}

/* ── Feature Cards ─────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  transition: var(--transition);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--green-500));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--ease);
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.card-icon {
  width: 54px; height: 54px;
  background: var(--gold-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.35rem;
  transition: var(--transition);
}

[data-theme="dark"] .card-icon { background: rgba(201,168,76,.12); }

.feature-card:hover .card-icon {
  background: var(--green-700);
  transform: scale(1.1) rotate(-5deg);
}

.feature-card h3  { font-size: 1.1rem; margin-bottom: .45rem; }
.feature-card p   { font-size: .9rem; line-height: 1.65; }

.card-arrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: 1rem;
  font-size: .83rem;
  font-weight: 700;
  color: var(--green-700);
  transition: gap .3s var(--ease);
}

.feature-card:hover .card-arrow { gap: .65rem; }

/* ── About Section ─────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-img-wrap {
  position: relative;
}

.about-img-wrap img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
}

.about-img-badge {
  position: absolute;
  bottom: -1.5rem; right: -1.5rem;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--green-900);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  box-shadow: var(--shadow-gold);
  min-width: 120px;
}

.about-img-badge .badge-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  display: block;
}

.about-img-badge .badge-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-top: .25rem;
}

.about-img-wrap::before {
  content: '';
  position: absolute;
  inset: -1rem;
  border: 2px solid rgba(201,168,76,.25);
  border-radius: calc(var(--radius-md) + 1rem);
  z-index: -1;
}

.about-content .section-label { margin-bottom: .65rem; }

.about-content h2 { margin-bottom: 1rem; }

.about-content p {
  font-size: 1.02rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}

.about-values {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin: 1.75rem 0;
}

.about-value {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .95rem;
  color: var(--gray-700);
  font-weight: 600;
}

.about-value i {
  width: 26px; height: 26px;
  background: var(--gold-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-700);
  font-size: .7rem;
  flex-shrink: 0;
}

[data-theme="dark"] .about-value i { background: rgba(201,168,76,.12); }
[data-theme="dark"] .about-value   { color: var(--gray-700); }

/* ── Course Cards ──────────────────────────────────────────── */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.course-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.course-card-img { position: relative; overflow: hidden; height: 210px; }
.course-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.course-card:hover .course-card-img img { transform: scale(1.08); }

.course-badge {
  position: absolute;
  top: .85rem; right: .85rem;
  background: var(--gold-500);
  color: var(--green-900);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .28rem .8rem;
  border-radius: var(--radius-full);
}

.course-card-body {
  padding: 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card-body h3  { font-size: 1.15rem; margin-bottom: .45rem; }
.course-card-body p   { font-size: .9rem; flex: 1; margin-bottom: 1.25rem; line-height: 1.65; }

/* ── Scholar Cards ─────────────────────────────────────────── */
.scholars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.75rem;
}

.scholar-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.scholar-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--green-500));
}

.scholar-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.scholar-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
  position: relative;
}

.scholar-avatar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--green-500));
  z-index: -1;
}

.scholar-card h3 { font-size: 1.05rem; margin-bottom: .25rem; }

.scholar-role {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin-bottom: .85rem;
}

.scholar-card p { font-size: .88rem; line-height: 1.65; }

/* ── Testimonials ──────────────────────────────────────────── */
.testimonials-section { position: relative; overflow: hidden; }

.testimonials-track {
  position: relative;
  min-height: 280px;
}

.testimonial-card {
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
  pointer-events: none;
}

.testimonial-card.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.testimonial-quote {
  font-size: 4rem;
  line-height: 1;
  color: var(--gold-200);
  font-family: Georgia, serif;
  margin-bottom: -.5rem;
}

[data-theme="dark"] .testimonial-quote { color: rgba(201,168,76,.25); }

.testimonial-text {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--gray-700);
  font-style: italic;
  flex: 1;
  margin-bottom: 1.5rem;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.testimonial-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--green-800);
  display: block;
}

[data-theme="dark"] .testimonial-name { color: #c8e6d0; }

.testimonial-meta {
  font-size: .82rem;
  color: var(--gray-500);
}

.testimonial-nav {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 2rem;
}

.t-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

[data-theme="dark"] .t-dot { background: rgba(255,255,255,.2); }

.t-dot.active {
  background: var(--gold-500);
  width: 24px;
  border-radius: 4px;
}

/* ── Events Section ────────────────────────────────────────── */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 780px;
  margin: 0 auto;
}

.event-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 1.75rem;
  transition: var(--transition);
  text-decoration: none;
}

.event-card:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--gold-500);
}

.event-date {
  flex-shrink: 0;
  text-align: center;
  background: var(--green-800);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  min-width: 70px;
  transition: var(--transition);
}

.event-card:hover .event-date { background: var(--gold-600); color: var(--green-900); }

.event-day {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  display: block;
}

.event-month {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .8;
}

.event-body { flex: 1; }

.event-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--green-800);
  margin-bottom: .3rem;
  display: block;
}

[data-theme="dark"] .event-title { color: #c8e6d0; }

.event-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.event-meta span {
  font-size: .82rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: .3rem;
}

.event-tag {
  display: inline-block;
  background: var(--gold-100);
  color: var(--gold-700);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .65rem;
  border-radius: var(--radius-full);
}

[data-theme="dark"] .event-tag { background: rgba(201,168,76,.12); }

.event-arrow {
  color: var(--gray-400);
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.event-card:hover .event-arrow { color: var(--gold-500); transform: translateX(4px); }

/* ── Newsletter Section ────────────────────────────────────── */
.newsletter-section {
  background: linear-gradient(135deg, var(--green-950) 0%, var(--green-800) 60%, var(--green-700) 100%);
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg,  rgba(201,168,76,.05) 0, rgba(201,168,76,.05) 1px, transparent 1px, transparent 35px),
    repeating-linear-gradient(-45deg, rgba(201,168,76,.05) 0, rgba(201,168,76,.05) 1px, transparent 1px, transparent 35px);
}

.newsletter-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-content .section-label {
  color: var(--gold-400);
  justify-content: center;
}

.newsletter-content .section-label::before,
.newsletter-content .section-label::after { background: var(--gold-400); }

.newsletter-content h2 {
  color: #fff;
  margin-bottom: .75rem;
}

.newsletter-content p {
  color: rgba(255,255,255,.7);
  margin-bottom: 2rem;
}

.newsletter-form {
  display: flex;
  gap: .75rem;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: .85rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: .95rem;
  font-family: var(--font-body);
  backdrop-filter: blur(6px);
  outline: none;
  transition: var(--transition);
}

.newsletter-input::placeholder { color: rgba(255,255,255,.5); }

.newsletter-input:focus {
  border-color: var(--gold-400);
  background: rgba(255,255,255,.15);
}

/* ── Verse Banner ──────────────────────────────────────────── */
.verse-banner {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  padding: 5.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.verse-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(60deg,  rgba(201,168,76,.06) 0, rgba(201,168,76,.06) 1px, transparent 1px, transparent 44px),
    repeating-linear-gradient(-60deg, rgba(201,168,76,.06) 0, rgba(201,168,76,.06) 1px, transparent 1px, transparent 44px);
}

.verse-banner-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.verse-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  color: var(--gold-200);
  line-height: 2.1;
  margin-bottom: .85rem;
  direction: rtl;
}

.verse-translation {
  font-size: 1.05rem;
  color: rgba(255,255,255,.78);
  font-style: italic;
  margin-bottom: .5rem;
  line-height: 1.7;
}

.verse-ref {
  font-size: .83rem;
  color: var(--gold-400);
  letter-spacing: .08em;
  font-weight: 600;
}

/* ── Reminder Cards ────────────────────────────────────────── */
.reminder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
}

.reminder-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.reminder-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.reminder-card::after {
  content: '﷽';
  position: absolute;
  bottom: -2rem; right: -.5rem;
  font-family: var(--font-arabic);
  font-size: 7rem;
  color: rgba(201,168,76,.05);
  pointer-events: none;
  line-height: 1;
}

.reminder-tag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--gold-100);
  color: var(--gold-700);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .reminder-tag { background: rgba(201,168,76,.12); }

.reminder-text-en {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--gray-700);
  font-style: italic;
  margin-bottom: 1rem;
}

.reminder-text-ur {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  line-height: 2;
  color: var(--gray-700);
  direction: rtl;
  text-align: right;
  margin-bottom: 1rem;
}

.reminder-source {
  font-size: .84rem;
  color: var(--gray-500);
  font-style: italic;
  border-top: 1px solid var(--border);
  padding-top: .85rem;
  margin-top: .85rem;
}

.reminder-actions { display: flex; gap: .65rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ── Quran Cards ───────────────────────────────────────────── */
.quran-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 760px;
  margin: 0 auto;
}

.quran-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.quran-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}

.quran-card-img { height: 180px; overflow: hidden; }
.quran-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

.quran-card:hover .quran-card-img img { transform: scale(1.07); }

.quran-card-body { padding: 1.75rem; flex: 1; display: flex; flex-direction: column; }
.quran-card-body h3 { margin-bottom: .45rem; }
.quran-card-body p  { flex: 1; margin-bottom: 1.25rem; font-size: .9rem; line-height: 1.65; }

/* ── Ayah Result ───────────────────────────────────────────── */
.result-stack { display: flex; flex-direction: column; gap: 1.5rem; max-width: 740px; margin: 0 auto; }

.result-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  transition: var(--transition);
}

.result-card:hover { box-shadow: var(--shadow-lg); }

.result-label {
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--gold-700);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.result-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.result-arabic {
  font-family: var(--font-arabic);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 2.1;
  direction: rtl;
  text-align: right;
  color: var(--green-800);
}

.result-text { font-size: 1.05rem; line-height: 1.85; color: var(--gray-700); }

.result-text-rtl {
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: var(--gray-700);
}

/* ── Form Styles ───────────────────────────────────────────── */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 3rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--card-border);
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.form-group { margin-bottom: 1.5rem; }

.form-label {
  display: block;
  font-size: .84rem;
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: .5rem;
  letter-spacing: .03em;
}

[data-theme="dark"] .form-label { color: #c8e6d0; }

.form-input {
  width: 100%;
  padding: .82rem 1.1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--gray-700);
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--green-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(64,145,108,.15);
}

.form-input::-webkit-inner-spin-button,
.form-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Page Hero ─────────────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--green-950) 0%, var(--green-800) 60%, var(--green-700) 100%);
  padding: calc(var(--nav-height) + 3.5rem) 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg,  rgba(201,168,76,.06) 0, rgba(201,168,76,.06) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(-45deg, rgba(201,168,76,.06) 0, rgba(201,168,76,.06) 1px, transparent 1px, transparent 32px);
}

.page-hero-content { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.25rem); }
.page-hero p  { color: rgba(255,255,255,.72); max-width: 500px; margin: .75rem auto 0; font-size: 1.05rem; }

.page-hero-meta {
  margin-top: 1.5rem;
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.meta-chip {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  font-weight: 600;
  padding: .32rem .9rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

/* ── Content Box ───────────────────────────────────────────── */
.content-box {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 3rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  max-width: 820px;
  margin: 0 auto;
}

.content-box h1 { margin-bottom: 1.25rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.content-box p  { font-size: 1.05rem; line-height: 1.9; color: var(--gray-700); }

/* ── Footer ────────────────────────────────────────────────── */
.footer { background: var(--green-900); padding: 5rem 0 0; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 3rem;
  padding-bottom: 4rem;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: .9rem;
  line-height: 1.8;
  color: rgba(255,255,255,.52);
  max-width: 280px;
  margin-bottom: 1.5rem;
}

.footer-socials { display: flex; gap: .6rem; }

.social-link {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: var(--green-900);
  transform: translateY(-3px);
}

.footer-col h4 {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 1.25rem;
  font-family: var(--font-body);
}

.footer-links { display: flex; flex-direction: column; gap: .6rem; }

.footer-links a {
  font-size: .9rem;
  color: rgba(255,255,255,.52);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.footer-links a:hover {
  color: var(--gold-400);
  transform: translateX(4px);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .84rem;
  color: rgba(255,255,255,.32);
}

.footer-bottom a { color: rgba(255,255,255,.42); transition: var(--transition); }
.footer-bottom a:hover { color: var(--gold-400); }
.footer-divider { margin: 0 .5rem; opacity: .35; }

/* ── Back to Top ───────────────────────────────────────────── */
#backToTop {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  color: var(--green-900);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(201,168,76,.4);
  z-index: 500;
  cursor: pointer;
  border: none;
  transform: translateY(80px);
  opacity: 0;
  transition: var(--transition);
}

#backToTop.visible {
  transform: translateY(0);
  opacity: 1;
}

#backToTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(201,168,76,.5);
}

/* ── Scroll Reveal ─────────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.fade-up.visible   { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .1s; }
.delay-2 { transition-delay: .2s; }
.delay-3 { transition-delay: .3s; }
.delay-4 { transition-delay: .4s; }
.delay-5 { transition-delay: .5s; }
.delay-6 { transition-delay: .6s; }

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(36px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-10px); }
}

@keyframes particleFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.1); opacity: .7; }
}

@keyframes preloaderLoad {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.flex-center  { display: flex; align-items: center; justify-content: center; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .about-grid   { grid-template-columns: 1fr; gap: 3rem; }
  .about-img-wrap { max-width: 560px; margin: 0 auto; }
  .about-img-wrap img { height: 380px; }
  .about-img-badge { bottom: -1rem; right: .5rem; }
  .footer-grid  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .mission-grid { grid-template-columns: 1fr; }
  .mission-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
  .mission-item:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
  .section      { padding: 4rem 0; }
  .form-card    { padding: 2rem; }
  .content-box  { padding: 2rem; }
  .reminder-grid { grid-template-columns: 1fr; }
  .newsletter-form { flex-direction: column; }
  .testimonial-card { padding: 2rem; }
  .event-card   { gap: 1rem; }
  .hero-stats   { gap: 1.5rem; }
}

@media (max-width: 480px) {
  .footer-grid  { grid-template-columns: 1fr; }
  .cards-grid   { grid-template-columns: 1fr; }
  .course-grid  { grid-template-columns: 1fr; }
  .quran-grid   { grid-template-columns: 1fr; }
  .scholars-grid { grid-template-columns: 1fr; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .hero-stats   { flex-wrap: wrap; gap: 1.25rem; justify-content: center; }
}
