/* الرئيسية: بابٌ مقوّس، وبابان إلى المصحف والأذكار. */

.section { padding-top: clamp(90px, 12vw, 150px); }
.section__head { display: grid; gap: 14px; margin-bottom: clamp(30px, 5vw, 54px); max-width: 720px; }
.section__head h2 { font-size: clamp(32px, 4.6vw, 54px); }

/* ——— البطل ——— */
.hero {
  min-height: min(100svh, 980px);
  display: grid;
  align-items: center;
  padding: 120px 0 70px;
  position: relative;
}
.hero__grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero__text { display: grid; gap: 22px; }
.hero__name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(88px, 13vw, 176px);
  line-height: 0.95;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.hero__name span { color: var(--gold); }
.hero__tag { font-family: var(--f-display); font-weight: 500; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.5; margin: 0; color: var(--ink-2); text-wrap: balance; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.hero__facts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.fact { display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; font-size: 17.5px; font-weight: 500; color: var(--ink-2); }
.fact svg { width: 16px; height: 16px; color: var(--gold); }

/* النافذة المقوّسة: شكل باب الشعار نفسه */
.arch {
  position: relative;
  aspect-ratio: 0.78;
  width: min(100%, 470px);
  margin-inline: auto;
  border-radius: 50% 50% 34px 34px / 34% 34% 34px 34px;
  padding: 16% 9% 9%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
  overflow: hidden;
  will-change: transform;
}
.arch::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: inherit;
  border: 1px solid color-mix(in srgb, var(--sand) 60%, transparent);
  pointer-events: none;
}
.arch .door { width: 58%; margin: 0 auto; align-self: center; }
.arch__verse { display: grid; gap: 8px; justify-items: center; text-align: center; }
.arch__verse .qsnippet { width: 100%; height: auto; max-height: 76px; }
.qsnippet__ink text { fill: var(--quran-ink); }
.arch__verse small { font-size: 17px; color: var(--muted); letter-spacing: 0.02em; }
.arch__verse .skeleton { width: 80%; height: 44px; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; font-size: 14.5px; color: var(--muted); }
.scroll-cue i { width: 1.5px; height: 34px; background: linear-gradient(var(--gold), transparent); animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ——— البابان ——— */
.portals { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 34px); }
.portal {
  position: relative;
  border-radius: 50% 50% var(--r-lg) var(--r-lg) / 150px 150px var(--r-lg) var(--r-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.portal:hover { transform: translateY(-8px); box-shadow: var(--shadow-lift); }
.portal__img { position: relative; aspect-ratio: 1.45; overflow: hidden; }
.portal__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.portal:hover .portal__img img { transform: scale(1.06); }
.portal__img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, var(--glass-strong), transparent 55%); }
.portal__body { position: relative; display: grid; gap: 14px; padding: 0 clamp(22px, 3vw, 36px) 32px; margin-top: -54px; }
.portal__icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--brand); color: var(--on-brand); box-shadow: 0 12px 26px -10px rgba(21, 42, 68, 0.6); }
.portal__icon svg { width: 28px; height: 28px; }
.portal h3 { font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 3.4vw, 40px); margin: 0; line-height: 1.2; }
.portal p { margin: 0; color: var(--ink-2); max-width: 46ch; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; padding: 0; list-style: none; }
.stats li { padding: 7px 14px; border-radius: 999px; background: var(--hl-hover); font-size: 17.5px; font-weight: 500; color: var(--ink-2); }
.stats b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 700; }
.portal__go { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--gold); margin-top: 4px; }
.portal__go svg { width: 20px; height: 20px; transition: transform 0.4s var(--ease); }
.portal:hover .portal__go svg { transform: translateX(-6px); }

/* ——— عرض المصحف ——— */
.showcase { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.live-page { perspective: 1400px; }
.live-page .paper {
  --ph: auto;
  height: auto;
  width: min(100%, 420px);
  margin-inline: auto;
  aspect-ratio: 0.655;
  max-height: none;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  padding: 5% 4% 6%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: rotateY(var(--tilt, -10deg)) rotateX(2deg);
  transition: transform 0.2s linear;
}
.live-page .paper::after { content: ''; position: absolute; inset: 10px; border: 1px solid color-mix(in srgb, var(--sand) 55%, transparent); border-radius: 12px; pointer-events: none; }
.live-page .qpage { width: 100%; height: auto; }
.qpage__ink text { fill: var(--quran-ink); }
.qpage__ink text.qpage__basmala { fill: var(--basmala); }
.qpage__ink text.qpage__surah { fill: #F0DCAC; }
.features { display: grid; gap: 14px; }
.feature { display: grid; grid-template-columns: 50px 1fr; gap: 16px; align-items: start; padding: 18px 20px; border-radius: var(--r-md); }
.feature__icon { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: color-mix(in srgb, var(--sand) 26%, transparent); color: var(--gold); }
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
.feature p { margin: 0; color: var(--ink-2); font-size: 17px; line-height: 1.8; }

/* ——— عرض الأذكار ——— */
.adhkar-show { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(20px, 3vw, 34px); align-items: stretch; }
.now-card { position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 380px; display: grid; align-content: end; color: #F7EEDC; isolation: isolate; }
.now-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 20% 50%; z-index: -2; transition: transform 1.4s var(--ease); }
.now-card:hover img { transform: scale(1.05); }
.now-card::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 17, 30, 0.88), rgba(8, 17, 30, 0.25) 60%, rgba(8, 17, 30, 0.05)); }
.now-card__body { padding: 30px; display: grid; gap: 8px; }
.now-card__body .eyebrow { color: #E7C996; }
.now-card h3 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 3.5vw, 42px); color: #FBF3E3; }
.now-card p { margin: 0; color: rgba(247, 238, 220, 0.82); }
.now-card .btn { justify-self: start; margin-top: 10px; background: rgba(251, 243, 227, 0.14); border-color: rgba(251, 243, 227, 0.3); color: #FBF3E3; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.now-card .btn:hover { background: rgba(251, 243, 227, 0.24); }

.tasbih { border-radius: var(--r-lg); padding: 28px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.tasbih__text { font-family: var(--f-naskh); font-size: 27px; font-weight: 600; line-height: 1.7; margin: 0; }
.tasbih__fadl { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); margin: 0; max-width: 40ch; }
.counter { position: relative; width: 168px; height: 168px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.counter svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.counter .track { stroke: var(--line); }
.counter .bar { stroke: var(--gold); transition: stroke-dashoffset 0.45s var(--ease); }
.counter__inner { width: 124px; height: 124px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: var(--brand); color: var(--on-brand); box-shadow: 0 16px 30px -12px rgba(21, 42, 68, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12); transition: transform 0.18s var(--ease); }
.counter:active .counter__inner { transform: scale(0.93); }
.counter__inner b { font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; font-weight: 700; }
.counter__inner small { font-size: 14.5px; opacity: 0.8; }
.counter.is-done .counter__inner { background: var(--good); }
.tasbih__hint { font-size: 17px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.tasbih__hint button { border: 0; background: none; color: var(--gold); font-weight: 600; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.tasbih__hint svg { width: 15px; height: 15px; }

.group-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(20px, 3vw, 30px); }
.group-chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px; border-radius: 999px; font-weight: 600; font-size: 16.5px; transition: transform 0.35s var(--ease), background 0.25s; }
.group-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.group-chip small { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.group-chip:hover { transform: translateY(-3px); background: var(--glass-strong); }

/* ——— التطبيق ——— */
.app-card { border-radius: var(--r-lg); padding: clamp(28px, 5vw, 60px); display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; overflow: hidden; }
.app-card h2 { font-size: clamp(30px, 4vw, 46px); }
.app-card ul { margin: 18px 0 24px; padding: 0; list-style: none; display: grid; gap: 10px; }
.app-card li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.app-card li svg { width: 20px; height: 20px; color: var(--gold); flex: none; margin-top: 5px; }
.soon { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--sand) 70%, transparent); color: var(--ink-2); font-weight: 600; }
.soon svg { width: 20px; height: 20px; color: var(--gold); }
.phones { position: relative; height: 440px; }
.phones img {
  position: absolute;
  width: 210px;
  border-radius: 28px;
  border: 6px solid #0B1626;
  box-shadow: 0 30px 60px -20px rgba(8, 17, 30, 0.55);
  top: 50%;
  left: 50%;
}
.phones img:nth-child(1) { transform: translate(-115%, -50%) rotate(-8deg); z-index: 1; }
.phones img:nth-child(2) { transform: translate(-50%, -56%); z-index: 3; }
.phones img:nth-child(3) { transform: translate(15%, -50%) rotate(8deg); z-index: 2; }

@media (max-width: 900px) {
  .hero__grid, .showcase, .adhkar-show, .app-card { grid-template-columns: 1fr; }
  .hero { padding-top: 100px; }
  .arch { width: min(84%, 380px); }
  .portals { grid-template-columns: 1fr; }
  .live-page { order: -1; }
  .phones { height: 360px; }
  .phones img { width: 160px; border-radius: 22px; border-width: 5px; }
}
@media (max-width: 640px) {
  .hero__cta .btn { flex: 1; justify-content: center; padding: 13px 16px; }
  .scroll-cue { display: none; }
  .portal { border-radius: 50% 50% var(--r-lg) var(--r-lg) / 110px 110px var(--r-lg) var(--r-lg); }
  .now-card { min-height: 320px; }
  .phones { height: 300px; }
  .phones img { width: 130px; border-radius: 18px; border-width: 4px; }
}

/* ——— المشهد المثبّت ——— */
.pin-scene { position: relative; height: 280svh; margin-top: clamp(60px, 8vw, 110px); }
.pin-scene__stage { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; padding-top: 70px; }
.pin-scene .live-page .paper {
  transform: rotateY(calc((1 - var(--p, 0) * 2.2) * -18deg)) rotateX(calc((1 - var(--p, 0) * 2.2) * 4deg)) scale(calc(0.86 + min(var(--p, 0) * 2.2, 1) * 0.14));
  transition: none;
  width: min(100%, 400px);
}
.feature { transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), box-shadow 0.5s, border-color 0.5s; }
.features.is-live .feature { opacity: 0.38; transform: translateX(-14px) scale(0.98); }
.features.is-live .feature.is-on { opacity: 1; transform: none; box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--sand) 70%, transparent); }
.feature.is-on .feature__icon { background: var(--brand); color: var(--sand); }
.scene-progress { margin-top: 18px; }
.scene-progress .bar { display: block; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.scene-progress .bar i { display: block; height: 100%; width: 0; background: var(--gold); }
@media (max-width: 900px), (max-height: 640px) {
  .pin-scene { height: auto; }
  .pin-scene__stage { position: static; height: auto; padding-top: 0; }
  .pin-scene .live-page .paper { transform: none; }
  .features.is-live .feature { opacity: 1; transform: none; }
  .scene-progress { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pin-scene .live-page .paper { transform: none; } }
.qpage__hl rect.sel { fill: var(--hl); transition: opacity 0.4s; }
.qpage__hl rect.hover { fill: transparent; }

/* لابتوب قصير (ارتفاع ≤ 860px): المشهد المثبّت يضغط تفاصيله كي يبقى الزرّ داخل الشاشة. */
@media (min-width: 901px) and (max-height: 860px) {
  .pin-scene__stage { padding-top: 64px; }
  .pin-scene .showcase .section__head { margin-bottom: 16px; gap: 10px; }
  .pin-scene .showcase .section__head h2 { font-size: clamp(28px, 3.4vw, 40px); }
  .pin-scene .showcase .lede { font-size: 17px; }
  .pin-scene .features { gap: 10px; }
  .pin-scene .feature { padding: 12px 16px; gap: 12px; grid-template-columns: 42px 1fr; }
  .pin-scene .feature__icon { width: 42px; height: 42px; border-radius: 12px; }
  .pin-scene .feature__icon svg { width: 21px; height: 21px; }
  .pin-scene .feature h3 { font-size: 18px; margin-bottom: 2px; }
  .pin-scene .feature p { font-size: 15.5px; line-height: 1.6; }
  .pin-scene .scene-progress { margin-top: 12px; }
  .pin-scene .live-page .paper { width: min(100%, 340px); }
}
