/* ==========================================================================
   الصفحة الرئيسية: مشاهد متتابعة بتمريرٍ واحد.
   كل مشهدٍ «مسرح» يثبت في الشاشة (sticky) بينما يُمرَّر طوله، و assets/scrolly.js يكتب تقدّمه فيه:
   --p من ٠ إلى ١ للحركات المتصلة، و data-step مع .on/.past على عناصر [data-at] للخطوات.
   بلا JavaScript (أو مع تقليل الحركة) تُعرض المشاهد كاملةً متتالية بلا تثبيت.
   ========================================================================== */

/* الموقع يقصّ الزخارف بـoverflow-x: hidden على body؛ وعلى الجوال يصير body حاوية تمرير فيتعطّل
   sticky. clip يقصّ ولا يصنع حاوية. */
html, body { overflow-x: clip; }

.sc { position: relative; }
.sc-kicker { display: inline-block; font-weight: 700; color: var(--primary); background: rgba(var(--primary-rgb), .1); border-radius: 999px; padding: 6px 16px; font-size: .95rem; }
.sc-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.sc-link:hover { text-decoration: underline; }
/* styles.css يعطي كل section حاشية؛ المشهد بلا حاشية كي يبدأ مسرحه من أعلاه ويُثبَّت طوله كلّه */
.sc-scene { position: relative; padding: 0; }
.sc-stage { position: relative; display: flex; align-items: center; min-height: 100vh; min-height: 100svh; padding: calc(var(--hdr, 80px) + 24px) 0 40px; }
.sc-stage > .container { width: 100%; }

/* ---------------------------------------------------------------- التثبيت (مع JavaScript) */
.sc-js .sc-scene { height: calc(var(--len, 2) * 100vh); height: calc(var(--len, 2) * 100svh); }
.sc-js .sc-stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; overflow: hidden; padding-bottom: 24px; }

/* ---------------------------------------------------------------- ١. البداية */
.sc-hero-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: center; }
.sc-hero-text h1 { margin: 18px 0 14px; font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.2; }
.sc-hero-text p { font-size: 1.15rem; line-height: 1.95; color: var(--on-surface-variant); max-width: 52ch; }
.sc-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 26px; }
.sc-hero-phone .phone { --s: .62; }
.sc-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: .85rem; color: var(--on-surface-variant); letter-spacing: .02em; }
.sc-hint::after { content: ''; display: block; width: 2px; height: 26px; margin: 8px auto 0; background: linear-gradient(var(--primary), transparent); animation: sc-hint 1.8s ease-in-out infinite; }
@keyframes sc-hint { 0%, 100% { transform: translateY(0); opacity: .9; } 50% { transform: translateY(8px); opacity: .3; } }
.sc-js .sc-hero-text { opacity: calc(1 - var(--p, 0) * 1.5); transform: translateY(calc(var(--p, 0) * -70px)); }
.sc-js .sc-hero-phone { transform: translateY(calc((1 - var(--p, 0)) * 40px)) scale(calc(.94 + var(--p, 0) * .1)) rotate(calc((1 - var(--p, 0)) * -3deg)); transform-origin: 50% 60%; }
.sc-js .sc-hint { opacity: calc(1 - var(--p, 0) * 4); }

/* ---------------------------------------------------------------- ٢. النمو */
.sc-grow { background: linear-gradient(180deg, transparent, rgba(var(--primary-rgb), .06) 30%, rgba(var(--primary-rgb), .06) 70%, transparent); }
.sc-grow-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; }
.sc-words { font-size: clamp(2rem, 5.2vw, 4.2rem); font-weight: 800; line-height: 1.45; margin: 0; max-width: 16ch; }
.sc-words span { display: inline-block; transition: opacity .25s, color .25s; }
.sc-js .sc-words span { opacity: clamp(.13, calc(var(--p, 0) * 13 - var(--i) * 1.1), 1); }
.sc-plant { display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 200px; }
.sc-plant-emoji { position: relative; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--primary-rgb), .14), rgba(var(--primary-rgb), .02) 70%); }
.sc-plant-emoji span, .sc-plant-name b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transform: scale(.7); transition: opacity .45s, transform .45s cubic-bezier(.2, .8, .2, 1.2); }
.sc-plant-emoji span { font-size: 96px; }
.sc-plant-name { position: relative; width: 100%; height: 44px; }
.sc-plant-name b { font-size: 1.6rem; color: var(--primary); }
.sc-plant-bar { width: 160px; height: 6px; border-radius: 3px; background: rgba(var(--primary-rgb), .15); overflow: hidden; }
.sc-plant-bar i { display: block; height: 100%; width: calc(var(--p, 1) * 100%); background: var(--primary); border-radius: 3px; }
.sc-grow-note { grid-column: 1 / -1; color: var(--on-surface-variant); font-size: 1.1rem; margin: 0; }
/* بلا JavaScript: المرحلة الأخيرة ظاهرة */
html:not(.sc-js) .sc-plant [data-at="9"], .sc-plant .on { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- ٣. المزايا */
.sc-feat { background: var(--surface-variant); }
.sc-feat-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center; }
.sc-feat-h { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin: 0 0 18px; }
.sc-caps { position: relative; min-height: 220px; }
.sc-cap h3 { font-size: clamp(1.7rem, 3.6vw, 2.8rem); margin: 6px 0 12px; line-height: 1.3; color: var(--primary); }
.sc-cap p { font-size: 1.2rem; line-height: 1.9; color: var(--on-surface); max-width: 42ch; margin: 0; }
.sc-cap-n { font-weight: 800; color: var(--on-surface-variant); font-size: .95rem; }
.sc-feat-bar { width: min(320px, 100%); height: 5px; border-radius: 3px; background: rgba(var(--primary-rgb), .14); overflow: hidden; margin: 22px 0 16px; }
.sc-feat-bar i { display: block; height: 100%; width: calc(var(--p, 1) * 100%); background: var(--primary); border-radius: 3px; }
.sc-feat-phone .phone { --s: .62; }
.sc-layer { position: absolute; inset: 0; }
.sc-layer > .m-screen { position: absolute; inset: 0; }
/* بلا JavaScript: الجمل متتالية، والهاتف على الشاشة الأولى */
html:not(.sc-js) .sc-cap + .sc-cap { margin-top: 26px; }
html:not(.sc-js) .sc-layer:not([data-at="0"]) { display: none; }
.sc-js .sc-cap { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(26px); transition: opacity .45s, transform .55s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
.sc-js .sc-cap.past { transform: translateY(-26px); }
.sc-js .sc-cap.on { opacity: 1; transform: none; pointer-events: auto; }
.sc-js .sc-layer { opacity: 0; transform: scale(.97); transition: opacity .5s, transform .6s cubic-bezier(.2, .7, .2, 1); }
.sc-js .sc-layer.on { opacity: 1; transform: none; }
.sc-js .sc-feat-phone { transform: translateY(calc((.5 - var(--p, 0)) * 30px)); }

/* ---------------------------------------------------------------- ٥. الخصوصية */
.sc-privacy { background: #1f3a31; color: #F4EAD3; }
[data-theme="dark"] .sc-privacy { background: #0f1e19; }
.sc-privacy-in { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.sc-line { margin: 0; font-size: clamp(2.4rem, 7vw, 5.6rem); font-weight: 900; line-height: 1.25; color: #F4EAD3; }
.sc-line-end { font-size: 1.25rem; font-weight: 500; line-height: 1.9; max-width: 46ch; margin-top: 22px; color: rgba(244, 234, 211, .85); }
.sc-line-end p { margin: 0 0 10px; }
.sc-privacy .sc-link { color: #E9D9A6; }
.sc-js .sc-line { opacity: 0; transform: translateY(40px); transition: opacity .6s, transform .7s cubic-bezier(.2, .7, .2, 1), color .6s; }
.sc-js .sc-line.on, .sc-js .sc-line.past { opacity: 1; transform: none; }
.sc-js .sc-line.past:not(.sc-line-end) { color: rgba(244, 234, 211, .38); }

/* ---------------------------------------------------------------- المقاطع العادية: الشخصيات والتعلّم والأسئلة والتحميل */
.sc-block { padding: calc(var(--hdr, 80px) + 30px) 0 90px; scroll-margin-top: 0; }
.sc-block h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.sc-sub { color: var(--on-surface-variant); font-size: 1.15rem; margin: 6px 0 30px; }
.sc-learn h2, .sc-learn .sc-sub { text-align: center; }
.sc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.sc-card { display: flex; flex-direction: column; gap: 8px; padding: 26px; border-radius: 24px; text-decoration: none; color: var(--on-surface); background: rgba(var(--surface-rgb), .75); border: 1px solid rgba(var(--primary-rgb), .12); transition: transform .3s, border-color .3s, box-shadow .3s; }
.sc-card:hover { transform: translateY(-4px); border-color: rgba(var(--primary-rgb), .45); box-shadow: 0 16px 34px rgba(0, 0, 0, .08); }
.sc-card-ic { font-size: 2.2rem; }
.sc-card h3 { margin: 0; font-size: 1.4rem; }
.sc-card p { margin: 0; color: var(--on-surface-variant); line-height: 1.8; flex: 1; }
.sc-download { background: linear-gradient(180deg, transparent, rgba(var(--primary-rgb), .1)); min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.sc-download-in { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.sc-download img { width: 120px; height: 120px; border-radius: 30px; box-shadow: 0 16px 40px rgba(var(--primary-rgb), .25); }
.sc-download h2 { margin: 6px 0 0; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.sc-download p { color: var(--on-surface-variant); font-size: 1.2rem; margin: 0 0 10px; }
.sc-js .sc-reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s calc(var(--d, 0) * .12s), transform .8s cubic-bezier(.2, .7, .2, 1) calc(var(--d, 0) * .12s); }
.sc-js .sc-reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- مؤشر الأقسام (الحاسوب) وشريط التقدّم (الهاتف) */
.sc-rail { position: fixed; z-index: 45; inset-inline-end: 22px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; align-items: flex-end; gap: 10px; }
.sc-js .sc-rail { display: flex; }
.sc-rail a { position: relative; display: block; width: 10px; height: 10px; border-radius: 5px; background: rgba(var(--primary-rgb), .25); transition: height .3s, background .3s; }
.sc-rail a.on { height: 30px; background: var(--primary); }
.sc-rail a span { position: absolute; inset-inline-end: 20px; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: .85rem; font-weight: 700; color: var(--primary); background: rgba(var(--surface-rgb), .92); padding: 4px 10px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.sc-rail a:hover span, .sc-rail a:focus-visible span { opacity: 1; }
.sc-progress { position: fixed; z-index: 49; top: var(--hdr, 80px); left: 0; right: 0; height: 3px; display: none; }
.sc-progress i { display: block; height: 100%; width: calc(var(--page, 0) * 100%); background: var(--primary); margin-inline-start: 0; }
.sc-privacy-active .sc-rail a { background: rgba(244, 234, 211, .35); }
.sc-privacy-active .sc-rail a.on { background: #E9D9A6; }

/* ---------------------------------------------------------------- الهاتف */
@media (max-width: 899px) {
  .sc-rail { display: none !important; }
  .sc-js .sc-progress { display: block; }
  .sc-stage { padding-top: calc(var(--hdr, 72px) + 14px); }
  .sc-hero-in { grid-template-columns: 1fr; gap: 18px; text-align: center; justify-items: center; }
  .sc-hero-text h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); margin: 12px 0 8px; }
  .sc-hero-text p { font-size: 1rem; line-height: 1.8; margin-inline: auto; }
  .sc-cta { justify-content: center; margin-top: 16px; gap: 12px; }
  .sc-hero-phone .phone, .sc-feat-phone .phone { --s: .6; }
  /* الهاتف يطلّ تحت النص ويعلو مع التمرير إلى مكانه، والنص يتنحّى. --hero-lift طول النص (scrolly.js) */
  .sc-hero .sc-stage { align-items: flex-start; }
  .sc-js .sc-hero-phone { transform: translateY(calc(var(--p, 0) * var(--hero-lift, 340px) * -1)) scale(calc(1 + var(--p, 0) * .08)); transform-origin: 50% 0; }
  .sc-js .sc-hero-text { opacity: calc(1 - var(--p, 0) * 2.8); transform: translateY(calc(var(--p, 0) * -40px)); }
  .sc-js .sc-hero-in { position: relative; }
  .sc-hint { display: none; }

  .sc-grow-in { grid-template-columns: 1fr; gap: 26px; text-align: center; justify-items: center; }
  .sc-words { font-size: clamp(1.9rem, 9vw, 2.8rem); max-width: none; }
  .sc-plant-emoji { width: 150px; height: 150px; }
  .sc-plant-emoji span { font-size: 76px; }

  .sc-feat-in { grid-template-columns: 1fr; gap: 14px; justify-items: center; height: 100%; align-content: start; }
  .sc-feat-text { order: 2; width: 100%; text-align: center; }
  .sc-feat-h { display: none; }
  .sc-feat-phone { order: 1; }
  .sc-caps { min-height: 150px; }
  .sc-cap h3 { font-size: 1.6rem; margin: 2px 0 6px; }
  .sc-cap p { font-size: 1.05rem; line-height: 1.75; margin-inline: auto; }
  .sc-feat-bar { margin: 10px auto 8px; width: 180px; }
  .sc-js .sc-feat-phone { transform: none; }

  .sc-line { font-size: clamp(2.2rem, 12vw, 3.6rem); }
  .sc-line-end { font-size: 1.05rem; }

  .sc-cards { grid-template-columns: 1fr; }
  .sc-block { padding-top: calc(var(--hdr, 72px) + 20px); padding-bottom: 60px; }
}
/* شاشات قصيرة: يصغر الهاتف (ارتفاعه نحو ٨٠٠px × --s) كي تسعه الشاشة مع جملته */
@media (min-width: 900px) and (max-height: 680px) {
  .sc-feat-phone .phone, .sc-hero-phone .phone { --s: .52; }
}
@media (min-width: 900px) and (max-height: 560px) {
  .sc-feat-phone .phone, .sc-hero-phone .phone { --s: .44; }
}
@media (max-width: 899px) and (max-height: 800px) {
  .sc-feat-phone .phone, .sc-hero-phone .phone { --s: .5; }
}
/* ويسقط شريط المزايا ورابطها، وفي الصفحة غيرهما */
@media (max-width: 899px) and (max-height: 760px) {
  .sc-feat-phone .phone, .sc-hero-phone .phone { --s: .46; }
  .sc-feat-bar, .sc-feat-text > .sc-link { display: none; }
}
@media (max-width: 899px) and (max-height: 680px) {
  .sc-feat-phone .phone, .sc-hero-phone .phone { --s: .4; }
  .sc-cap h3 { font-size: 1.4rem; }
  .sc-cap p { font-size: 1rem; line-height: 1.65; }
}
@media (max-width: 899px) and (max-height: 580px) {
  .sc-feat-phone .phone, .sc-hero-phone .phone { --s: .32; }
  .sc-words { font-size: 1.7rem; }
  .sc-plant-emoji { width: 110px; height: 110px; }
  .sc-plant-emoji span { font-size: 56px; }
}

/* ---------------------------------------------------------------- تقليل الحركة: تبقى الخطوات وتسقط الحركات */
.sc-reduced .sc-hero-text, .sc-reduced .sc-hero-phone, .sc-reduced .sc-feat-phone { transform: none !important; opacity: 1 !important; }
.sc-reduced * { transition-duration: 0s !important; animation: none !important; }
