/* مُثبّت — البطل السينمائي «الصعود».
   المشهد ثابت أثناء التمرير، والمحتوى يمر فوقه: البطل، ثم عنوان كبير، ثم أقسام ملف التسليم، ثم ختم الشهادة،
   ثم ضباب الفجر الذي يخرج منه القسم التالي. البرج في الثلث الأيسر من المقطع، فالنصوص كلها في السماء على يمينه. */

.climb { position: relative; background: var(--ink); color: #fff; --hk: 1; --haze: 0; --sv: 100vh; margin-bottom: calc(var(--sv) * -.85); }
/* القسم التالي يخرج من الضباب: يعلو آخر المشهد بعد أن يصير أبيض */
.climb + .subnav + .sec { position: relative; z-index: 2; background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 260px); }
@supports (height: 100svh) { .climb { --sv: 100svh; } }

/* ---------- المشهد ---------- */
.cl-scene { position: sticky; top: 0; height: var(--sv); overflow: hidden; z-index: 0; isolation: isolate; }
.cl-media, .cl-media picture, .cl-poster, .cl-still img, .cl-video { position: absolute; inset: 0; width: 100%; height: 100%; }
.cl-poster, .cl-still img, .cl-video { object-fit: cover; object-position: 50% 50%; }
.cl-still img { opacity: 0; }
.climb.at-seal:not(.has-video) .cl-still img { opacity: 1; }
.cl-video { opacity: 0; transition: opacity .5s ease; }
.climb.has-video .cl-video { opacity: 1; }
/* ظل البطل: يحمي النص على اليمين، ويخفت مع بداية الصعود */
.cl-shade { position: absolute; inset: 0; opacity: var(--hk); background:
  linear-gradient(270deg, rgba(6, 18, 26, .94) 0%, rgba(6, 18, 26, .8) 34%, rgba(6, 18, 26, .22) 62%, rgba(6, 18, 26, 0) 80%),
  linear-gradient(180deg, rgba(6, 18, 26, .7) 0%, rgba(6, 18, 26, 0) 22%); }
/* إطار سينمائي خفيف ثابت: يحمي العناوين والعداد فوق المدينة */
.cl-vig { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(270deg, rgba(6, 18, 26, .55) 0%, rgba(6, 18, 26, .25) 40%, rgba(6, 18, 26, 0) 62%),
  linear-gradient(0deg, rgba(6, 18, 26, .8) 0%, rgba(6, 18, 26, 0) 24%),
  linear-gradient(180deg, rgba(6, 18, 26, .45) 0%, rgba(6, 18, 26, 0) 16%); }
/* ضباب الفجر: يغطي المشهد في آخر الصعود بلون الصفحة */
.cl-haze { position: absolute; inset: 0; background: #fff; opacity: var(--haze); pointer-events: none; }

/* ---------- عداد الجاهزية ---------- */
.cl-hud { position: absolute; inset-inline: 0; bottom: 0; padding-bottom: 22px; opacity: calc(1 - var(--haze) * 2.2); }
.cl-hud-in { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 16px; font-size: 12.5px; color: #A9BFC8; }
.cl-hud-t { color: #D2E1E6; font-weight: 500; }
.cl-pct { font-family: var(--h); font-weight: 700; font-size: 22px; color: #fff; line-height: 1; min-width: 3.2em; direction: ltr; unicode-bidi: isolate; text-align: end; font-variant-numeric: tabular-nums; }
.cl-bar { width: clamp(90px, 12vw, 180px); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); overflow: hidden; display: block; }
.cl-bar i { display: block; height: 100%; width: 51%; background: var(--teal-2); border-radius: inherit; box-shadow: 0 0 12px rgba(60, 203, 195, .8); }
.climb.done .cl-pct { color: var(--teal-2); }
.cl-leg { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: 8px; }
.cl-win { width: 10px; height: 13px; border-radius: 1.5px; display: inline-block; background: linear-gradient(180deg, #FFE2A8, #F2B35E); box-shadow: 0 0 10px rgba(255, 196, 110, .75); }
.cl-hint { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; color: #D2E1E6; transition: opacity .4s; }
.cl-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.cl-hint-dot { animation: clHint 1.8s ease-in-out infinite; }
@keyframes clHint { 0%, 100% { transform: translateY(0); opacity: 1; } 60% { transform: translateY(4px); opacity: .2; } }
.climb.moved .cl-hint { opacity: 0; }

/* ---------- المحتوى فوق المشهد ---------- */
.cl-content { position: relative; z-index: 1; margin-top: calc(var(--sv) * -1); }
.cl-hero.hero { background: none; min-height: var(--sv); overflow: visible; isolation: auto; }
.cl-hero .hero-in { padding-bottom: 120px; }

.cl-kick { font-family: var(--h); font-weight: 600; font-size: 13px; letter-spacing: .06em; color: var(--teal-2); display: inline-flex; align-items: center; gap: 10px; margin-bottom: 16px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.cl-kick::before { content: ''; width: 26px; height: 1.5px; background: currentColor; }

/* حماية النص فوق البرج: ظل ناعم خلف العنوان */
.cl-rise .in, .cl-seal .in { position: relative; isolation: isolate; }
.cl-rise .in::before, .cl-seal .in::before { content: ''; position: absolute; z-index: -1; inset: -18% -14%; pointer-events: none;
  display: none; }

/* العنوان الصاعد على محور البرج */
.cl-rise { min-height: var(--sv); display: grid; align-items: center; padding: 30vh 0 18vh; }
.cl-rise .in > * { max-width: 46%; }
.cl-lines { font-size: clamp(40px, 5.6vw, 84px); font-weight: 700; line-height: 1.06; letter-spacing: -.01em; text-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35); }
.cl-lines span { display: block; white-space: nowrap; }
.cl-lines span:nth-child(even) { color: #E4F4F3; }
.cl-lines span:last-child { color: var(--teal-2); }

/* أقسام الملف على جانبي البرج */
.cl-files { width: min(var(--max), 100% - 48px); margin-inline: auto; padding-bottom: 10vh; }
.cl-row { display: grid; grid-template-columns: repeat(2, minmax(0, 300px)); gap: 48px; justify-content: start; align-items: start; }
.cl-row + .cl-row { margin-top: 42vh; }
.cl-row .cl-f:last-child { margin-top: 14vh; }
.cl-f { width: min(300px, 100%); text-shadow: 0 2px 14px rgba(0, 0, 0, .7); }
.cl-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; background: rgba(60, 203, 195, .12); border: 1px solid rgba(60, 203, 195, .45); box-shadow: 0 0 24px -6px rgba(60, 203, 195, .6); }
.cl-ic svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cl-f h3 { font-size: clamp(20px, 1.75vw, 25px); font-weight: 700; line-height: 1.3; }
.cl-f p { margin-top: 10px; font-size: 15.5px; line-height: 1.75; color: rgba(236, 245, 247, .9); }
.cl-st { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 12px 4px 10px; background: rgba(46, 111, 183, .22); border: 1px solid rgba(46, 111, 183, .6); color: #CFE0F5; text-shadow: none; transition: background .5s, border-color .5s, color .5s; }
.cl-st i { width: 8px; height: 8px; border-radius: 50%; background: var(--s-rev); transition: background .5s, box-shadow .5s; }
.cl-st em { font-style: normal; }
.cl-st .ok { display: none; }
.cl-f.ok .cl-st { background: rgba(22, 166, 160, .24); border-color: rgba(60, 203, 195, .7); color: #D5F6F3; }
.cl-f.ok .cl-st i { background: var(--teal-2); box-shadow: 0 0 10px var(--teal-2); }
.cl-f.ok .cl-st .w { display: none; } .cl-f.ok .cl-st .ok { display: inline; }

/* ختم الشهادة */
.cl-seal { min-height: calc(var(--sv) * 1.1); display: grid; align-items: center; padding: 12vh 0; }
.cl-seal .in > * { max-width: 600px; }
/* ظل ناعم خلف نص الختم: يقع فوق أضواء المدينة في آخر المقطع */
.cl-seal .in::before { display: block; inset: -30% -8% -30% 30%; background: radial-gradient(ellipse at 70% 55%, rgba(6, 18, 26, .82) 0%, rgba(6, 18, 26, .55) 40%, rgba(6, 18, 26, 0) 72%); }
.cl-seal .in > .cl-p { max-width: 440px; }
.cl-seal .cl-p, .cl-seal .cl-no { text-shadow: 0 2px 14px rgba(0, 0, 0, .9); }
.cl-stamp { position: relative; width: 104px; height: 104px; margin: 0 0 22px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgba(22, 166, 160, .35), rgba(10, 28, 38, .55) 70%); box-shadow: 0 0 60px -6px rgba(60, 203, 195, .7); }
.cl-stamp img { width: 40px; height: auto; position: relative; z-index: 1; }
.cl-stamp svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--teal-2); stroke-width: 1.4; stroke-dasharray: 3 7; animation: clSpin 30s linear infinite; }
@keyframes clSpin { to { transform: rotate(360deg); } }
.cl-seal h2 { font-size: clamp(32px, 4.4vw, 62px); font-weight: 700; line-height: 1.18; text-shadow: 0 12px 36px rgba(0, 0, 0, .6); }
.cl-seal h2 .hl { color: var(--teal-2); }
.cl-p { margin: 18px 0 0; max-width: 460px; font-size: clamp(16px, 1.3vw, 18px); color: rgba(236, 245, 247, .92); text-shadow: 0 2px 12px rgba(0, 0, 0, .7); }
.cl-no { margin-top: 22px; display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 10px 18px; font-size: 13.5px; }
.cl-no .mono { background: rgba(10, 28, 38, .55); border: 1px solid rgba(60, 203, 195, .5); border-radius: 999px; padding: 5px 14px; color: #CFF3EF; backdrop-filter: blur(6px); }
.cl-no a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: rgba(60, 203, 195, .8); }
.cl-no a:hover { color: var(--teal-2); }

/* مسافة الخروج: المشهد يذوب في ضباب الفجر */
.cl-out { height: calc(var(--sv) * 2); }

/* ---------- الدخول: الأسطر والأقسام ترتفع حين تظهر ---------- */
.climb.anim .cl-lines span, .climb.anim .cl-rise .cl-kick,
.climb.anim .cl-f, .climb.anim .cl-seal .in > * {
  opacity: 0; transform: translateY(34px); filter: blur(8px);
  transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1), filter .9s cubic-bezier(.2, .7, .2, 1);
}
.climb.anim .seen .cl-lines span, .climb.anim .seen .cl-kick, .climb.anim .cl-f.seen, .climb.anim .cl-seal.seen .in > * { opacity: 1; transform: none; filter: none; }
.cl-lines span:nth-child(2) { transition-delay: .08s; } .cl-lines span:nth-child(3) { transition-delay: .16s; } .cl-lines span:nth-child(4) { transition-delay: .24s; }
.cl-seal .in > :nth-child(2) { transition-delay: .06s; } .cl-seal .in > :nth-child(3) { transition-delay: .12s; } .cl-seal .in > :nth-child(4) { transition-delay: .2s; } .cl-seal .in > :nth-child(5) { transition-delay: .28s; }

/* ---------- الجوال والشاشات الطولية: عمود واحد في المنتصف ---------- */
@media (max-aspect-ratio: 4/5), (max-width: 760px) {
  .cl-shade { background: linear-gradient(0deg, rgba(6, 18, 26, .97) 0%, rgba(6, 18, 26, .9) 44%, rgba(6, 18, 26, .2) 72%, rgba(6, 18, 26, .5) 100%); }
  .cl-hero .hero-in { padding-top: 44vh; padding-bottom: 40px; }
  /* العداد يظهر بعد أن يرتفع نص البطل، حتى لا يزاحم الأزرار */
  .cl-hud { padding-bottom: 14px; transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
  .climb:not(.past-hero) .cl-hud { transform: translateY(110%); }
  .cl-hud-in { gap: 6px 12px; font-size: 12px; padding-top: 12px; }
  .cl-leg { display: none; }
  .cl-bar { flex: 1; width: auto; }
  .cl-hint { width: 100%; margin: 0; justify-content: center; font-size: 12px; }
  .cl-rise { padding: 26vh 0 12vh; text-align: center; }
  .cl-rise .in > *, .cl-seal .in > * { max-width: none; }
  .cl-rise .in::before, .cl-seal .in::before { display: block; background: radial-gradient(closest-side, rgba(6, 18, 26, .75), rgba(6, 18, 26, .5) 50%, rgba(6, 18, 26, 0)); }
  .cl-rise .cl-kick::after, .cl-seal .cl-kick::after { content: ''; width: 26px; height: 1.5px; background: currentColor; }
  .cl-lines { font-size: clamp(38px, 11.5vw, 64px); }
  .cl-row { display: block; }
  .cl-seal { text-align: center; }
  .cl-stamp { margin-inline: auto; }
  .cl-p { margin-inline: auto; }
  .cl-no { justify-content: center; }
  .cl-row + .cl-row { margin-top: 30vh; }
  .cl-row .cl-f:last-child { margin-top: 30vh; }
  .cl-f { width: auto; max-width: 420px; margin-inline: auto; text-align: center; padding: 22px 20px 20px; border-radius: 16px; background: rgba(8, 22, 30, .62); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-shadow: none; }
  .cl-ic { margin-inline: auto; }
  .cl-seal { padding: 10vh 0; }
  .cl-seal .in > * { text-shadow: 0 2px 14px rgba(0, 0, 0, .8); }
}
@media (max-width: 1080px) and (min-aspect-ratio: 4/5) and (min-width: 761px) {
  .cl-row { grid-template-columns: repeat(2, minmax(0, 250px)); gap: 32px; }
  .cl-f p { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .cl-hint-dot, .cl-stamp svg { animation: none; }
  .cl-st, .cl-st i { transition: none; }
}

/* الشاشات القصيرة (الحاسوب المحمول): نص البطل يتسع فوق العداد */
@media (min-aspect-ratio: 4/5) and (min-width: 761px) and (max-height: 820px) {
  .cl-hero .hero-in { padding-top: calc(var(--bar-h) + 34px); padding-bottom: 92px; }
  .cl-hero .product { margin-bottom: 16px; }
  .cl-hero h1 { font-size: clamp(32px, 6.6vh, 56px); }
  .cl-hero .lead { margin-top: 14px; }
  .cl-hero .see { margin-top: 14px; }
}

/* ---------- لمسة سينمائية للصور في بقية الصفحة: الصورة تنفتح كستارة حين تظهر ---------- */
.js .pain-img.reveal img, .js .cert-photo.reveal img { clip-path: inset(9% 7% 9% 7% round 12px); transform: scale(1.12); transition: clip-path 1.5s cubic-bezier(.2, .7, .2, 1), transform 1.8s cubic-bezier(.2, .7, .2, 1); }
.js .pain-img.reveal.on img, .js .cert-photo.reveal.on img { clip-path: inset(0 0 0 0 round 12px); transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .pain-img.reveal img, .js .cert-photo.reveal img { clip-path: none; transform: none; transition: none; }
}
