/* مؤسسة المتميزون التعليمية — ثلاثة أقسام، صفحة واحدة، بلا سكربتات */

@font-face {
  font-family: Cairo;
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("assets/fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC;
}
/* الأحرف والأرقام اللاتينية تُترك لخط النظام: توفير ~36 كيلوبايت مقابل
   بضعة أرقام هاتف فقط في الصفحة. */

:root {
  --ink: #221c27;
  --muted: #6b6473;
  --brand: #8e2f5e;
  --brand-deep: #5e1c3d;
  /* الذهبي من شرّابة القبعة في الشعار، والقاتم من إطاره */
  --gold: #a8761b;
  --gold-bright: #e0a93f;
  --bg: #fff;
  --tint: #fbf5f8;
  --line: #ebe4ec;
  --btn-fg: #fff;
  --veil: #240c19;
  --radius: 14px;
  --head: 75px;
  --font: Cairo, "Segoe UI", Tahoma, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f0eaf1;
    --muted: #a8a0af;
    --brand: #f0a0c4;
    --brand-deep: #a85b84;
    --gold: #e8bd6d;
    --gold-bright: #f2cf8a;
    --bg: #17131a;
    --tint: #1f1923;
    --line: #322a36;
    --btn-fg: #2b1020;
  }
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* التمرير يتوقف عند بداية كل قسم بدل الانزلاق المستمر. */
  scroll-snap-type: y proximity;
  scroll-padding-top: var(--head);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.9 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.45; margin: 0; font-weight: 800; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
address { font-style: normal; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: fixed;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  z-index: 50;
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.wrap {
  width: min(1060px, 100% - 44px);
  margin-inline: auto;
}

/* ── الحركات ──────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes kenburns {
  from { transform: scale(1.05); }
  to { transform: scale(1.14) translate3d(1.5%, -1.5%, 0); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-6%, 7%, 0) scale(1.18); }
}
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ── الترويسة ─────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
/* خيط ملوّن رفيع يربط الترويسة بألوان الشعار */
.site-head::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--gold-bright), var(--brand));
  opacity: .75;
}

.head-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: calc(var(--head) - 1px);
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold-bright) 55%, transparent);
}
.brand strong { display: block; font-size: 19px; font-weight: 800; line-height: 1.3; }
.brand small { display: block; font-size: 12px; color: var(--muted); line-height: 1.3; }

.site-nav { display: flex; gap: 26px; font-size: 15px; font-weight: 600; }
.site-nav a { color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--gold); }

.head-cta {
  flex: none;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  transition: border-color .2s, color .2s, background .2s;
}
.head-cta:hover {
  border-color: transparent;
  color: var(--btn-fg);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}

/* ── القسم الواحد ─────────────────────────── */

.snap {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--head));
  padding-block: clamp(32px, 5vh, 62px);
  scroll-snap-align: start;
  overflow: hidden;
}
.snap > .wrap, .snap > .closing-in { position: relative; z-index: 1; }

.snap.tinted {
  background: linear-gradient(180deg, var(--tint) 0%, var(--bg) 78%);
  border-block: 1px solid var(--line);
}
/* هالتان لونيتان خفيفتان تكسران بياض الخلفية */
.snap.tinted::before,
.snap.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 52% at 88% 10%, color-mix(in srgb, var(--brand) 13%, transparent), transparent 70%),
    radial-gradient(48% 46% at 8% 92%, color-mix(in srgb, var(--gold-bright) 16%, transparent), transparent 72%);
}
.snap.closing::before { opacity: .55; }

p.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
}
p.label::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--gold-bright));
}

.snap h2 {
  font-size: clamp(23px, 3.2vw, 30px);
  max-width: 30ch;
  margin-bottom: 14px;
}

.snap p { color: var(--muted); max-width: 62ch; }

/* ── ١ الواجهة ────────────────────────────── */

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  animation: kenburns 28s ease-in-out infinite alternate;
}

/* التعتيم: أغمق خلف النص (يمين الشاشة) وأفتح فوق بقية الصورة */
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to left,
      color-mix(in srgb, var(--veil) 94%, transparent) 0%,
      color-mix(in srgb, var(--veil) 80%, transparent) 42%,
      color-mix(in srgb, var(--veil) 56%, transparent) 100%),
    linear-gradient(to top,
      color-mix(in srgb, var(--veil) 82%, transparent) 0%,
      transparent 52%);
}

.hero-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}
.hero-glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  animation: drift 20s ease-in-out infinite alternate;
}
.hero-glow span:nth-child(1) {
  width: 46vmin; height: 46vmin;
  inset-block-start: -8vmin; inset-inline-end: 6vmin;
  background: var(--brand);
}
.hero-glow span:nth-child(2) {
  width: 38vmin; height: 38vmin;
  inset-block-end: -6vmin; inset-inline-start: 14vmin;
  background: var(--gold-bright);
  opacity: .38;
  animation-duration: 26s;
  animation-direction: alternate-reverse;
}
.hero-glow span:nth-child(3) {
  width: 30vmin; height: 30vmin;
  inset-block-start: 40%; inset-inline-start: -8vmin;
  background: #6d2f7a;
  opacity: .34;
  animation-duration: 32s;
}

.hero-in { display: grid; }
.hero-text { max-width: 640px; }
.hero-text > * { animation: rise .8s cubic-bezier(.22, .8, .3, 1) both; }
.hero-text > :nth-child(1) { animation-delay: .05s; }
.hero-text > :nth-child(2) { animation-delay: .15s; }
.hero-text > :nth-child(3) { animation-delay: .28s; }
.hero-text > :nth-child(4) { animation-delay: .4s; }
.hero-text > :nth-child(5) { animation-delay: .52s; }

p.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-bright);
}
p.kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  box-shadow: 0 0 12px currentColor;
}

.hero h1 {
  font-size: clamp(31px, 6.2vw, 52px);
  line-height: 1.32;
  max-width: 18ch;
  margin-bottom: 20px;
  color: #fff;
  text-shadow: 0 2px 26px rgb(0 0 0 / .45);
}

.lead {
  max-width: 56ch;
  font-size: clamp(17px, 2.1vw, 19px);
  color: var(--muted);
}
.hero .lead { color: rgb(255 255 255 / .86); }
.lead-sm { max-width: 64ch; color: var(--muted); margin-bottom: 0; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: var(--btn-fg);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 34%, transparent);
}
.btn-primary:hover { box-shadow: 0 12px 30px color-mix(in srgb, var(--brand) 46%, transparent); }
/* لمعة تمرّ على الزر عند المرور عليه */
.btn-primary::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -60%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .38), transparent);
  transform: skewX(-18deg);
  transition: inset-inline-start .55s ease;
}
.btn-primary:hover::after { inset-inline-start: 115%; }

.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--bg); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: var(--tint); }

.hero .btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), #c8871f);
  color: #2a1408;
  box-shadow: 0 10px 28px rgb(0 0 0 / .35);
}
.hero .btn-ghost {
  border-color: rgb(255 255 255 / .42);
  color: #fff;
  background: rgb(255 255 255 / .08);
  backdrop-filter: blur(6px);
}
.hero .btn-ghost:hover {
  border-color: #fff;
  color: #fff;
  background: rgb(255 255 255 / .18);
}

.stages {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}
.stages li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid rgb(255 255 255 / .28);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: rgb(255 255 255 / .9);
  background: rgb(255 255 255 / .08);
  backdrop-filter: blur(6px);
  transition: background .2s, border-color .2s;
}
.stages li:hover { background: rgb(255 255 255 / .18); border-color: rgb(255 255 255 / .5); }
.stages li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-bright);
}

/* سهم يوضّح أن تحت الواجهة أقساماً أخرى */
.scroll-hint {
  position: absolute;
  z-index: 2;
  inset-block-end: 22px;
  inset-inline: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: rgb(255 255 255 / .75);
}
.scroll-hint svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 2.4s ease-in-out infinite;
}
.scroll-hint:hover { color: #fff; }

/* ── ٢ البوابة ────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.features li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 13px;
  align-items: start;
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.features li:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--brand) 14%, transparent);
}
.features svg {
  grid-row: 1;
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  padding: 9px;
  border-radius: 12px;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--brand) 15%, transparent),
    color-mix(in srgb, var(--gold-bright) 22%, transparent));
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .22s;
}
.features li:hover svg { transform: scale(1.08) rotate(-4deg); }
.features h3 { grid-row: 1; font-size: 16.5px; margin: 0; align-self: center; }
.features p { grid-column: 2; font-size: 15px; line-height: 1.7; }

.actions-portal { margin-top: 20px; }

/* ── ٣ أسئلة وتواصل ───────────────────────── */

.closing-in {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: min(1060px, 100% - 44px);
  margin-inline: auto;
}

.closing-grid {
  display: grid;
  gap: clamp(30px, 4vw, 54px);
  align-items: start;
}

.faq { margin-top: 16px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  transition: background .2s, color .2s, transform .25s;
}
.faq details[open] summary::after {
  content: "\2212";
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: var(--btn-fg);
  transform: rotate(180deg);
}
.faq summary:hover { color: var(--brand); }
.faq summary:hover::after { background: color-mix(in srgb, var(--gold-bright) 32%, transparent); }
.faq details[open] p { animation: rise .35s ease-out both; }
.faq p {
  margin: 0 0 16px;
  font-size: 16px;
}

.contact-block { margin-bottom: 18px; }
.contact-block:last-child { margin-bottom: 0; }
.contact h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 8px;
}
.contact address { color: var(--muted); margin-bottom: 6px; }

.phones, .links { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.phones a, .link {
  color: var(--ink);
  width: fit-content;
  border-bottom: 1px solid var(--line);
  transition: color .2s, border-color .2s;
}
.phones a:hover, .link:hover { color: var(--brand); border-bottom-color: var(--gold-bright); }
.ltr { direction: ltr; unicode-bidi: isolate; }

.site-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

/* ── ظهور العناصر مع التمرير ───────────────
   مدعوم في المتصفحات الحديثة فقط؛ غيرها يعرض المحتوى كما هو. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    #portal .label,
    #portal h2,
    #portal .lead-sm,
    #portal .features li,
    #portal .actions-portal,
    #contact .label,
    #contact h2,
    #contact .faq details,
    #contact .contact-block {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 8% cover 26%;
    }
  }
}

/* ── الشاشات ─────────────────────────────── */

@media (min-width: 900px) {
  .closing-grid { grid-template-columns: 1.08fr 0.92fr; }
  /* صفّان من ثلاث بطاقات، أفضل من صف رابع ناقص */
  .features { grid-template-columns: repeat(3, 1fr); }
}

/* توقّف قاطع عند كل قسم — فقط حين تتسع الشاشة لعرض القسم كاملاً،
   حتى لا يُحجب جزء من المحتوى على الشاشات القصيرة. */
@media (min-width: 1180px) and (min-height: 760px) {
  html { scroll-snap-type: y mandatory; }
  .snap { scroll-snap-stop: always; }
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .scroll-hint { display: none; }
  .snap { min-height: 0; padding-block: clamp(46px, 9vw, 70px); }
  .hero { min-height: calc(100svh - var(--head)); }
  /* الهالة الثالثة والضبابية العالية مكلفة على الهواتف الضعيفة */
  .hero-glow span:nth-child(3) { display: none; }
  .hero-glow span { filter: blur(48px); }
  .hero-veil {
    background:
      linear-gradient(to left,
        color-mix(in srgb, var(--veil) 82%, transparent) 0%,
        color-mix(in srgb, var(--veil) 68%, transparent) 100%),
      linear-gradient(to top,
        color-mix(in srgb, var(--veil) 72%, transparent) 0%,
        transparent 58%);
  }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap, .closing-in { width: min(1060px, 100% - 32px); }
  .brand small { display: none; }
  .head-cta { padding: 9px 16px; font-size: 14px; }
  .btn { width: 100%; }
}

@media (max-height: 640px) {
  .snap { min-height: 0; padding-block: 56px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
