/* عوالم محلولة: فواصل الملفات، البوابة، وصفحات العوالم الأربعة.
   يُحمَّل بعد store.css ويستعمل متغيراته. لون العالم في --w */

@view-transition { navigation: auto; }

/* ===== فواصل الملفات ===== */
.wtabs { --ft: 18px; --tab-sheet: #fff; padding-top: 16px; box-shadow: inset 0 -1px 0 var(--rule); position: relative; z-index: 2;
  overflow-x: clip; } /* قدم الفاصل الطرفي لا تخرج عن الشاشة فتُزيح الصفحة في الجوال */
.wtabs-row { display: flex; gap: 4px; align-items: flex-end; }
.wtab {
  --tint: color-mix(in srgb, var(--w) 11%, var(--paper));
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 16px; border-radius: 16px 16px 0 0;
  background: var(--tint); color: color-mix(in srgb, var(--w) 72%, #0b1020);
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--w) 45%, transparent), inset 0 -1px 0 var(--rule);
  text-decoration: none; font-weight: 700; font-size: 16px; line-height: 1.2; white-space: nowrap;
  transition: height .22s ease, background-color .22s ease, color .22s ease;
}
.wtab svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wtab small { font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; opacity: .55; }
.wtab:hover { height: 57px; background: color-mix(in srgb, var(--w) 17%, var(--paper)); }
.wtab[aria-current="page"] {
  z-index: 3; height: 64px; background: var(--tab-sheet); color: var(--w);
  box-shadow: inset 0 4px 0 var(--w), 0 -6px 18px -10px color-mix(in srgb, var(--w) 60%, transparent);
}
.wtab[aria-current="page"] small { opacity: .75; }
/* قدما الفاصل النشط: ينحني ويلتحم بالورقة تحته */
.wtab[aria-current="page"]::before, .wtab[aria-current="page"]::after {
  content: ""; position: absolute; bottom: 0; width: var(--ft); height: var(--ft); pointer-events: none;
}
.wtab[aria-current="page"]::before { right: calc(var(--ft) * -1); background: radial-gradient(circle at 100% 0, transparent calc(var(--ft) - .5px), var(--tab-sheet) var(--ft)); }
.wtab[aria-current="page"]::after { left: calc(var(--ft) * -1); background: radial-gradient(circle at 0 0, transparent calc(var(--ft) - .5px), var(--tab-sheet) var(--ft)); }
.wt-l { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }

/* ===== الورقة: جسم الصفحة تحت الفاصل ===== */
.wsheet { background: #fff; }
.w-page { --w: var(--stamp); }
.w-page .top { background: rgba(242, 244, 248, .95); border-bottom: 0; }

/* ===== الافتتاحية ===== */
.w-hero { padding: 56px 0 64px; overflow: hidden; }
.w-hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.w-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 5px 14px; border-radius: 999px; background: color-mix(in srgb, var(--w) 10%, #fff); color: color-mix(in srgb, var(--w) 80%, #000); font-weight: 600; font-size: 14.5px; }
.w-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--w); }
.w-hero h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(44px, 6.4vw, 78px); line-height: 1.12; letter-spacing: -.5px; }
.w-hero h1 .accent { color: var(--w); }
.w-lead { margin: 18px 0 28px; font-size: 19px; color: var(--ink-soft); max-width: 34em; }
.w-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.w-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 24px; border-radius: 12px; background: var(--w); color: #fff; font-weight: 700; font-size: 16.5px; text-decoration: none; border: 2px solid var(--w); transition: transform .15s, box-shadow .15s; }
.w-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px var(--w); }
.w-btn.ghost { background: transparent; color: color-mix(in srgb, var(--w) 85%, #000); }

/* رزمة الأوراق في الافتتاحية */
.w-stack { position: relative; height: 440px; }
.w-paper {
  position: absolute; inset-inline: 8% 4%; padding: 22px 24px 20px; border-radius: 6px 18px 18px 18px;
  background: #fff; border: 1px solid var(--rule); box-shadow: 0 18px 40px -22px rgba(20, 33, 61, .45);
}
.w-paper::before { /* لسان الورقة */
  content: attr(data-tab); position: absolute; top: -30px; right: 18px; height: 30px; padding: 0 16px;
  display: grid; place-items: center; border-radius: 12px 12px 0 0; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--w) 14%, #fff); color: color-mix(in srgb, var(--w) 80%, #000);
  border: 1px solid var(--rule); border-bottom: 0;
}
/* الموضع في data-pos، وworlds.js يدوّره فتنتقل الورقة الأمامية إلى الخلف (Card Swap) */
.w-paper { transition: top .75s cubic-bezier(.65, 0, .25, 1), transform .75s cubic-bezier(.65, 0, .25, 1), box-shadow .75s; }
.w-paper[data-pos="1"] { top: 34px; transform: rotate(-4deg); z-index: 1; }
.w-paper[data-pos="2"] { top: 158px; transform: rotate(2.5deg); z-index: 2; }
.w-paper[data-pos="3"] { top: 282px; transform: rotate(-1deg); z-index: 3; box-shadow: 0 22px 44px -20px color-mix(in srgb, var(--w) 45%, rgba(20, 33, 61, .5)); }
.w-paper:nth-child(1)::before { right: 52%; }
.w-paper:nth-child(2)::before { right: 30%; }
.w-paper::before { transition: background-color .5s, color .5s, border-color .5s; }
.w-paper[data-pos="3"]::before { background: var(--w); color: #fff; border-color: var(--w); }
.w-paper b { display: block; font-size: 19px; line-height: 1.45; }
.w-paper span { display: block; margin-top: 6px; height: 8px; width: 82%; border-radius: 4px; background: var(--paper); }
.w-paper span + span { width: 58%; }
.w-seal {
  z-index: 4; cursor: pointer; user-select: none;
  position: absolute; left: 0; top: 0; width: 112px; height: 112px; border-radius: 50%;
  display: grid; place-items: center; transform: rotate(-14deg);
  border: 3px solid var(--w); color: var(--w); font-family: var(--display); font-size: 26px;
  background: color-mix(in srgb, var(--w) 6%, #fff);
  box-shadow: inset 0 0 0 5px #fff, inset 0 0 0 7px color-mix(in srgb, var(--w) 40%, transparent);
  animation: seal .7s cubic-bezier(.2, 1.6, .4, 1) .4s both;
}
@keyframes seal { from { transform: rotate(-14deg) scale(1.8); opacity: 0; } }

/* ===== الأقسام ===== */
.w-sec { padding: 64px 0; }
.w-sec.alt { background: var(--paper); }
.w-head { margin: 0 0 28px; display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.w-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 3.8vw, 42px); line-height: 1.25; }
.w-head p { margin: 4px 0 0; color: var(--ink-soft); }
.w-more { color: color-mix(in srgb, var(--w) 85%, #000); font-weight: 700; text-decoration: none; white-space: nowrap; }
.w-more:hover { text-decoration: underline; text-underline-offset: 5px; }

/* الأدوار */
.w-roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.w-role { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid var(--rule); text-decoration: none; font-weight: 700; font-size: 17px; transition: border-color .15s, transform .15s; }
.w-role:hover { border-color: var(--w); transform: translateY(-2px); }
.w-role i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--w) 12%, #fff); color: var(--w); font-style: normal; flex: none; }
.w-role i svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.w-role em { margin-inline-start: auto; color: var(--w); font-style: normal; }

/* بطاقات الفهرس: كل تخصص فاصل */
.w-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 30px 18px; padding-top: 22px; }
.w-card {
  position: relative; display: flex; flex-direction: column; padding: 22px 22px 18px; border-radius: 4px 16px 16px 16px;
  background: #fff; border: 1px solid var(--rule); text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.w-card::before { /* لسان البطاقة برقمها */
  content: attr(data-n); position: absolute; top: -22px; right: -1px; height: 22px; min-width: 52px; padding: 0 12px;
  display: grid; place-items: center; border-radius: 10px 10px 0 0; font: 700 12px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .08em;
  background: color-mix(in srgb, var(--w) 14%, #fff); color: color-mix(in srgb, var(--w) 80%, #000); border: 1px solid var(--rule); border-bottom: 0;
}
.w-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--w) 55%, var(--rule)); box-shadow: 0 16px 30px -22px rgba(20, 33, 61, .5); }
.w-card:hover::before { background: var(--w); color: #fff; border-color: var(--w); }
.w-card h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.45; }
.w-card ul { list-style: none; margin: 0 0 14px; padding: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.w-card li { padding: 4px 0; border-top: 1px dashed var(--rule); }
.w-card li:first-child { border-top: 0; }
.w-card .go { margin-top: auto; color: var(--w); font-weight: 700; font-size: 15px; }

/* المختارات */
.w-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.w-pick { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 16px; background: #fff; border: 1px solid var(--rule); text-decoration: none; transition: transform .18s, border-color .18s; }
.w-pick:hover { transform: translateY(-3px); border-color: var(--w); }
.w-pick .tag { align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: color-mix(in srgb, var(--w) 10%, #fff); color: color-mix(in srgb, var(--w) 82%, #000); }
.w-pick .tag.ready { background: var(--marker); color: var(--ink); }
.w-pick h3 { margin: 0; font-size: 18.5px; line-height: 1.45; }
.w-pick p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.w-pick .go { margin-top: auto; padding-top: 6px; color: var(--w); font-weight: 700; font-size: 15px; }

/* رحلة المتجر */
.w-journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: st; }
.w-step { position: relative; padding: 26px 20px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--rule); counter-increment: st; }
.w-step::before { content: counter(st); position: absolute; top: -18px; right: 18px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--w); color: #fff; font-weight: 700; box-shadow: 0 0 0 5px var(--paper); }
.w-step:not(:last-child)::after { content: ""; position: absolute; top: 0; left: -16px; width: 16px; border-top: 2px dashed color-mix(in srgb, var(--w) 50%, transparent); }
.w-step h3 { margin: 4px 0 2px; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--w); }
.w-step > p { margin: 0 0 12px; color: var(--ink-soft); font-size: 15px; }
.w-step ul { list-style: none; margin: 0; padding: 0; }
.w-step li a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px dashed var(--rule); text-decoration: none; font-size: 15px; font-weight: 600; line-height: 1.5; }
.w-step li a::after { content: "←"; color: var(--w); }
.w-step li a:hover { color: var(--w); }

/* القيم */
.w-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--ink); }
.w-value { padding: 22px 22px 6px 0; }
.w-value + .w-value { border-inline-start: 1px solid var(--rule); padding-inline-start: 22px; }
.w-value b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--w); line-height: 1.3; }
.w-value p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15.5px; }

/* دعوة ختامية */
.w-band { padding: 0 0 72px; }
.w-band .box { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 34px 36px; border-radius: 22px; background: var(--w); color: #fff; position: relative; overflow: hidden; }
.w-band .box::after { content: "محلولة"; position: absolute; left: -10px; bottom: -34px; font-family: var(--display); font-size: 130px; line-height: 1; opacity: .09; pointer-events: none; }
.w-band h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.3; }
.w-band p { margin: 4px 0 0; opacity: .85; }
.w-band .w-btn { background: #fff; color: var(--w); border-color: #fff; position: relative; z-index: 1; }
.w-band .w-btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }

/* عوالم أخرى */
.w-others { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.w-other { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid var(--rule); text-decoration: none; transition: border-color .15s; }
.w-other:hover { border-color: var(--w); }
.w-other svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--w); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.w-other b { display: block; font-size: 16.5px; }
.w-other small { color: var(--ink-soft); font-size: 13.5px; }

/* ===== البوابة في الرئيسية ===== */
.gate { padding: 56px 0 70px; background: #fff; }
.gate-head { text-align: center; max-width: 760px; margin: 0 auto 50px; }
.gate-head h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(42px, 6vw, 72px); line-height: 1.15; }
.gate-head h1 .accent { color: var(--stamp); }
.gate-head p { margin: 16px auto 0; font-size: 19px; color: var(--ink-soft); max-width: 36em; }
.gate-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 16px; }
.gate-card {
  position: relative; display: flex; flex-direction: column; padding: 24px 22px 20px; border-radius: 4px 18px 18px 18px;
  background: color-mix(in srgb, var(--w) 5%, #fff); border: 1px solid color-mix(in srgb, var(--w) 22%, var(--rule));
  text-decoration: none; transition: transform .2s, box-shadow .2s;
}
.gate-card:hover { transform: translateY(-5px); box-shadow: 0 24px 40px -26px var(--w); }
.gate-tab {
  position: absolute; top: -34px; right: -1px; height: 34px; padding: 0 16px; display: flex; align-items: center; gap: 7px;
  border-radius: 14px 14px 0 0; background: var(--w); color: #fff; font-weight: 700; font-size: 15px;
}
.gate-tab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gate-en { font: 700 11.5px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: var(--w); opacity: .8; }
.gate-card h2 { margin: 10px 0 8px; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.3; }
.gate-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.7; }
.gate-card ul { list-style: none; margin: 0 0 18px; padding: 0; font-size: 14.5px; font-weight: 600; }
.gate-card li { padding: 6px 0; border-top: 1px dashed color-mix(in srgb, var(--w) 28%, var(--rule)); }
.gate-card .go { margin-top: auto; display: inline-flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 10px; background: #fff; border: 1px solid color-mix(in srgb, var(--w) 30%, var(--rule)); color: var(--w); font-weight: 700; }
.gate-card:hover .go { background: var(--w); color: #fff; border-color: var(--w); }

/* ===== الجوال ===== */
@media (max-width: 1000px) {
  .gate-grid { grid-template-columns: repeat(2, 1fr); }
  .w-journey { grid-template-columns: repeat(2, 1fr); gap: 30px 16px; }
  .w-step:nth-child(2)::after { display: none; }
  .w-picks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .w-hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .w-stack { height: 370px; max-width: 460px; width: 100%; margin: 0 auto; }
  .w-paper[data-pos="2"] { top: 136px; }
  .w-paper[data-pos="3"] { top: 238px; }
  .w-seal { width: 92px; height: 92px; font-size: 21px; }
  .w-roles, .w-others { grid-template-columns: repeat(2, 1fr); }
  .w-values { grid-template-columns: 1fr; }
  .w-value, .w-value + .w-value { padding: 18px 0 14px; border-inline-start: 0; border-top: 1px solid var(--rule); }
  .w-value:first-child { border-top: 0; }
}
@media (max-width: 640px) {
  .wtabs { --ft: 12px; padding-top: 10px; }
  .wtabs .wrap { padding: 0 10px; }
  .wtabs-row { gap: 3px; }
  .wtab { flex-direction: column; gap: 3px; height: 56px; padding: 0 4px; border-radius: 12px 12px 0 0; font-size: 13.5px; }
  .wtab:hover { height: 56px; }
  .wtab[aria-current="page"] { height: 64px; }
  .wtab svg { width: 20px; height: 20px; }
  .wt-l { align-items: center; }
  .wtab small, .wt-x { display: none; }
  .w-hero { padding: 34px 0 44px; }
  .w-lead { font-size: 17px; }
  .w-cta .w-btn { flex: 1 1 100%; justify-content: center; }
  .w-sec { padding: 46px 0; }
  .w-picks, .w-journey { grid-template-columns: 1fr; }
  .w-step::after { display: none; }
  .w-roles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .w-role { padding: 12px; font-size: 15px; gap: 8px; }
  .w-role i { width: 34px; height: 34px; }
  .w-role em { display: none; }
  .w-others { grid-template-columns: 1fr; }
  .w-band .box { padding: 28px 22px; }
  .w-band .w-btn { flex: 1 1 100%; justify-content: center; }
  .gate { padding: 36px 0 50px; }
  .gate-head { margin-bottom: 44px; }
  .gate-grid { grid-template-columns: 1fr; gap: 44px; }
  .gate-card h2 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  .wtab, .w-card, .w-pick, .gate-card, .w-btn, .w-paper, .fold * { transition: none !important; }
  @view-transition { navigation: none; }
}

/* ===================================================================
   مؤثرات مستوحاة من React Bits، مكتوبة بلا React (worlds.js)
   =================================================================== */

/* 1) Folder: ملف في بطاقة البوابة ينفتح وتطلع أوراقه */
.fold { position: relative; display: block; width: 96px; height: 74px; margin: 0 0 14px; perspective: 360px; }
.fold-back { position: absolute; inset: 10px 0 0; border-radius: 4px 12px 12px 12px; background: color-mix(in srgb, var(--w) 70%, #0b1020); }
.fold-back::before { content: ""; position: absolute; top: -9px; right: 0; width: 40px; height: 12px; border-radius: 7px 7px 0 0; background: inherit; }
.fold-paper {
  position: absolute; bottom: 8px; height: 54px; border-radius: 5px; background: #fff;
  background-image: repeating-linear-gradient(180deg, transparent 0 11px, color-mix(in srgb, var(--w) 22%, transparent) 11px 12px);
  background-position: 0 8px; box-shadow: 0 1px 3px rgba(20, 33, 61, .25);
  transition: transform .45s cubic-bezier(.3, 1.5, .5, 1);
}
.fold-paper:nth-child(2) { left: 18px; right: 12px; }
.fold-paper:nth-child(3) { left: 12px; right: 16px; transition-delay: .04s; }
.fold-paper:nth-child(4) { left: 14px; right: 14px; transition-delay: .08s; }
.fold-front {
  position: absolute; inset: 26px 0 0; border-radius: 6px 6px 12px 12px; background: var(--w);
  transform-origin: 50% 100%; transition: transform .45s cubic-bezier(.3, 1.3, .5, 1);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .22), transparent 40%);
}
.gate-card:is(:hover, :focus-visible, .open) .fold-front { transform: rotateX(-34deg); }
.gate-card:is(:hover, :focus-visible, .open) .fold-paper:nth-child(2) { transform: translate(-10px, -24px) rotate(-10deg); }
.gate-card:is(:hover, :focus-visible, .open) .fold-paper:nth-child(3) { transform: translate(8px, -30px) rotate(8deg); }
.gate-card:is(:hover, :focus-visible, .open) .fold-paper:nth-child(4) { transform: translateY(-18px); }

/* 2) Rotating Text: الكلمة المتبدّلة في عنوان البوابة */
.rot { display: inline-block; color: var(--rc, var(--stamp)); transition: transform .38s cubic-bezier(.6, 0, .3, 1), opacity .38s, color .38s; }
.rot.out { transform: translateY(-.45em); opacity: 0; }
.rot.in { transform: translateY(.45em); opacity: 0; transition: none; }
.gate-head .kick { display: block; margin-bottom: 10px; font-family: var(--body); font-size: 17px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0; }

/* 3) Spotlight Card: ضوء بلون العالم يتبع المؤشر (للكمبيوتر فقط) */
@property --sa { syntax: "<number>"; inherits: false; initial-value: 0; }
@media (hover: hover) and (pointer: fine) {
  :is(.w-card, .w-pick, .gate-card, .w-step, .w-role) {
    background-image: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--w) calc(var(--sa) * 13%), transparent), transparent 72%);
    transition-property: transform, box-shadow, border-color, --sa;
    transition-duration: .2s, .2s, .2s, .35s;
  }
  :is(.w-card, .w-pick, .gate-card, .w-step, .w-role):hover { --sa: 1; }
}

/* 4) Click Spark: شرارة عند الضغط */
.spark { position: fixed; z-index: 99; width: 0; height: 0; pointer-events: none; }
.spark i { position: absolute; left: -1.5px; top: -1.5px; width: 3px; height: 14px; border-radius: 2px; background: var(--sc, var(--stamp)); transform-origin: 50% 0; animation: spark .5s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes spark {
  from { transform: rotate(var(--r)) translateY(4px) scaleY(1); opacity: 1; }
  to { transform: rotate(var(--r)) translateY(26px) scaleY(.2); opacity: 0; }
}
.w-seal.restamp { animation: reseal .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes reseal { from { transform: rotate(-14deg) scale(1.6); opacity: .2; } }

/* ===================================================================
   حركة الصفحات: الافتتاحية، الظهور بالتمرير، رحلة المتجر، والانتقال بين الصفحات
   =================================================================== */

/* أ) الافتتاحية المتسلسلة: السطر الصغير، ثم العنوان كلمة كلمة، ثم الأوراق، ثم الختم.
   الصنف intro يُضاف في <head> لمن لم يطلب تقليل الحركة، والكلمات يقسمها worlds.js */
@keyframes up { from { opacity: 0; translate: 0 14px; } }
@keyframes wordUp { from { opacity: 0; translate: 0 .45em; filter: blur(6px); } }
@keyframes paperIn { from { opacity: 0; translate: 0 -46px; } }
@keyframes show { to { opacity: 1; } }
.intro .w-hero .w-kicker { animation: up .5s cubic-bezier(.2, .8, .2, 1) both .05s; }
.intro .w-hero h1:not(.split) { opacity: 0; animation: show 0s 1.2s forwards; } /* إن تعطل السكربت يظهر العنوان */
.intro .w-hero .wd { display: inline-block; animation: wordUp .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.15s + var(--i) * .09s); }
.intro .w-hero .w-lead { animation: up .6s cubic-bezier(.2, .8, .2, 1) both .55s; }
.intro .w-hero .w-cta { animation: up .6s cubic-bezier(.2, .8, .2, 1) both .7s; }
.intro .w-paper { animation: paperIn .7s cubic-bezier(.2, .9, .3, 1.15) both; }
.intro .w-paper:nth-child(1) { animation-delay: .35s; }
.intro .w-paper:nth-child(2) { animation-delay: .48s; }
.intro .w-paper:nth-child(3) { animation-delay: .61s; }
.intro .w-seal { animation-delay: 1s; }

/* ب) الظهور عند التمرير: البطاقات تدخل واحدة بعد الأخرى (IntersectionObserver) */
@keyframes rvIn { from { opacity: 0; translate: 0 26px; } }
.rv:not(.in) { opacity: 0; }
.rv.in { animation: rvIn .65s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0s); }

/* ج) رحلة متجرك: ثابتة ومكتملة، وخط متصل يربط دوائر المحطات (للكمبيوتر) */
.j-wrap { position: relative; }
.j-line { display: none; }
.j-wrap .w-step::after { display: none; }
@media (min-width: 1001px) {
  .j-line { display: block; position: absolute; z-index: 1; inset-inline: 40px; top: -1px; height: 2px; border-radius: 2px; pointer-events: none;
    background: linear-gradient(to left, var(--w), color-mix(in srgb, var(--w) 35%, transparent)); }
  .j-wrap .w-step::before { z-index: 2; }
  /* حركة الظهور تبقي البطاقة في طبقة مستقلة فيمر الخط فوق الرقم؛ بعد انتهائها تعود الطبقة عادية */
  .j-wrap .w-step.rv.in { animation-fill-mode: backwards; }
}

/* د) الملف يتحول إلى فاصل: لسان بطاقة البوابة ينتقل ويصير الفاصل في صفحة العالم (View Transitions) */
.w-page .wtab[data-w="learning"], .gate-card[data-w="learning"] .gate-tab { view-transition-name: tab-learning; }
.w-page .wtab[data-w="business"], .gate-card[data-w="business"] .gate-tab { view-transition-name: tab-business; }
.w-page .wtab[data-w="commerce"], .gate-card[data-w="commerce"] .gate-tab { view-transition-name: tab-commerce; }
.w-page .wtab[data-w="personal"], .gate-card[data-w="personal"] .gate-tab { view-transition-name: tab-personal; }
.top { view-transition-name: top; }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: cubic-bezier(.65, 0, .25, 1); }
::view-transition-old(root) { animation: .25s ease both vt-out; }
::view-transition-new(root) { animation: .35s ease .1s both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* «تقليل الحركة» في الجوال: لا إزاحة ولا قفز، والظهور تلاشٍ هادئ بدل إلغاء الحركة كلها
   (كثير من أجهزة آيفون مفعّل فيها هذا الخيار، فكانت الصفحة تبدو بلا أي حركة) */
@media (prefers-reduced-motion: reduce) {
  @keyframes up { from { opacity: 0; } }
  @keyframes wordUp { from { opacity: 0; } }
  @keyframes paperIn { from { opacity: 0; } }
  @keyframes rvIn { from { opacity: 0; } }
  @keyframes seal { from { opacity: 0; } }
  @keyframes reseal { from { opacity: .3; } }
  .rot { transition: opacity .5s ease, color .5s ease; }
  .rot.out, .rot.in { transform: none; }
}

/* الجوال: لا ماوس فيه، فالبطاقة التي تصل وسط الشاشة تضيء (worlds.js يضيف .on) والضغط يعطي إحساس الزر */
@media (hover: none), (pointer: coarse) {
  .w-card, .w-pick, .w-step, .w-role, .w-other {
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .35s, box-shadow .35s; }
  .w-card::before { transition: background-color .35s, color .35s, border-color .35s; }
  .w-card.on, .w-step.on { border-color: color-mix(in srgb, var(--w) 55%, var(--rule)); box-shadow: 0 18px 34px -24px color-mix(in srgb, var(--w) 70%, rgba(20, 33, 61, .6)); }
  .w-card.on::before { background: var(--w); color: #fff; border-color: var(--w); }
  .w-pick.on, .w-role.on, .w-other.on { border-color: var(--w); box-shadow: 0 14px 28px -22px var(--w); }
  :is(.w-card, .w-pick, .w-step, .w-role, .w-other, .w-btn):active { transform: scale(.97); transition-duration: .12s; }
}

/* روابط التذييل أسهل للمس في الجوال (كانت 27 بكسل ارتفاعاً) */
@media (pointer: coarse) {
  .foot-links a, .foot-links .linkish { display: inline-flex; align-items: center; min-height: 40px; }
}
