/* ============================================================
   سجل التحضير — شارة مهندس ذكاء اصطناعي (سدايا)
   التوكنات مأخوذة حرفياً من القسم ٦ في ملف المواصفات — لا إعادة تصميم.
   ============================================================ */

/* ---------- ١. الخطوط: ثمانية، مستضافة محلياً (لا CDN) ---------- */

@font-face {
  font-family: "Thmanyah Sans";
  src: url("fonts/thmanyahsans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("fonts/thmanyahsans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Sans";
  src: url("fonts/thmanyahsans-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("fonts/thmanyahserifdisplay-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Thmanyah Serif Display";
  src: url("fonts/thmanyahserifdisplay-Black.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ---------- ٢. التوكنات ---------- */

:root {
  --ink:#16202b;  --ink2:#445563;  --ink3:#7b8994;
  --paper:#f6f8f6; --surface:#fff;  --rule:#dbe0dc;
  --teal:#0f5c58;  --teal-soft:#e4efec;
  --good:#1f6b45;  --good-soft:#e6f2ea;
  --miss:#9e3129;  --miss-soft:#f7e8e6;
  --amber-soft:#fdf3e0; --amber-line:#d9a441;

  --sans: "Thmanyah Sans", "SF Arabic", "Geeza Pro", "Segoe UI", system-ui, sans-serif;
  --display: "Thmanyah Serif Display", "SF Arabic", "Geeza Pro", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r: 3px;                /* نصف قطر واحد في كل مكان */
  --w: 780px;              /* عرض المحتوى الأقصى */
  --gap: 28px;
}

/* ---------- ٣. الأساس ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 17px;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  line-height: 2;
  color: var(--ink);
  background: var(--paper);
  text-align: right;
  overflow-wrap: break-word;
}

/* لا تباعد أحرف على العربية أبداً — يكسر وصل الحروف */
body, p, li, td, th, h1, h2, h3, h4 { letter-spacing: 0; }

.wrap { max-width: var(--w); margin-inline: auto; padding-inline: 20px; }

/* ---------- ٤. اتجاه النص: العربية والإنجليزية معاً ---------- */

/* المصطلحات الإنجليزية داخل نص عربي. isolate لا embed:
   embed يسمح للأقواس والأرقام في نهاية المصطلح بأن تُعاد ترتيبها
   مع النص العربي المجاور، وهو الكسر نفسه الذي نحاول منعه. */
.en {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--sans);
}
bdi { unicode-bidi: isolate; }

/* الكود لاتيني دائماً: الوراثة من RTL تعكس ترتيب المعاملات وتقلب الإزاحة */
pre, code, kbd, samp {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  font-family: var(--mono);
}

/* ---------- ٥. العناوين ---------- */

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.45; font-weight: 700; }

h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.05rem;
  letter-spacing: 0;
}
h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-top: 2.2em;
  padding-bottom: .35em;
  border-bottom: 1px solid var(--rule);
}
h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.13rem;
  margin-top: 1.9em;
  color: var(--ink);
}
h3 .en { font-weight: 400; color: var(--ink3); font-size: .93em; }

p { margin: 0 0 1.05em; }
a { color: var(--teal); text-decoration: none; border-bottom: 1px solid var(--teal-soft); }
a:hover { border-bottom-color: var(--teal); }
strong, b { font-weight: 700; }

/* ---------- ٦. القوائم ---------- */

ul, ol { margin: 0 0 1.2em; padding-inline-start: 1.4em; }
li { margin-bottom: .35em; }
li::marker { color: var(--ink3); }

/* ---------- ٧. الوصولية: تركيز ظاهر على كل عنصر تفاعلي ---------- */

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--r);
}

/* ---------- ٨. الأزرار والحقول ---------- */

button, .btn {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: .5em 1.1em;
  cursor: pointer;
  text-align: center;
}
button:hover, .btn:hover { border-color: var(--ink3); }
button:disabled { cursor: default; color: var(--ink3); }

button.primary, .btn.primary {
  background: var(--teal); color: #fff; border-color: var(--teal); font-weight: 500;
}
button.primary:hover, .btn.primary:hover { background: #0c4a47; border-color: #0c4a47; }

input[type="date"], input[type="text"] {
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: .45em .7em;
  direction: ltr;
  text-align: center;
}

/* ---------- ٩. رأس الصفحة وتذييلها ---------- */

.site-head {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  padding-block: 14px;
}
.site-head .wrap { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.site-head .mark {
  font-family: var(--display); font-weight: 900; font-size: 1.05rem; color: var(--teal);
}
.site-head .sub { font-size: .82rem; color: var(--ink3); line-height: 1.6; }
.site-head nav { margin-inline-start: auto; display: flex; gap: 6px; }

.site-foot {
  margin-top: 64px;
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding-block: 22px;
  font-size: .84rem;
  color: var(--ink3);
  line-height: 1.9;
}
.site-foot a { color: var(--ink2); border-bottom-color: var(--rule); }

main { padding-block: 34px 10px; }

/* ---------- ١٠. لافتة التخزين ---------- */

.banner {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: .9rem;
  line-height: 1.85;
}

/* ---------- ١١. شرائط الثقة: رسمي / مستنتج / غير معلوم ---------- */

.tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.7;
  padding: .05em .6em;
  border-radius: var(--r);
  border: 1px solid;
  white-space: nowrap;
  vertical-align: middle;
}
.tag.official { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.tag.inferred { background: var(--amber-soft); border-color: var(--amber-line); color: #8a6410; }
.tag.unknown  { background: var(--paper);     border-color: var(--ink3);      color: var(--ink2); }

/* أوزان الجلسات */
.weight { font-size: .74rem; color: var(--ink2); white-space: nowrap; }
.weight.w-heavy    { color: #8a6410; font-weight: 500; }
.weight.w-heaviest { color: var(--teal); font-weight: 700; }
.weight.w-roi      { color: var(--good); font-weight: 700; }

/* ---------- ١٢. الغلاف: بطاقة جلسة اليوم ---------- */

.hero {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 26px 24px;
  margin-bottom: 30px;
}
.hero .eyebrow {
  font-size: .78rem; font-weight: 500; color: var(--teal);
  text-transform: none; margin-bottom: 6px; line-height: 1.8;
}
.hero h1 { font-size: 1.72rem; margin-bottom: .25em; }
.hero .meta { font-size: .88rem; color: var(--ink2); line-height: 1.9; margin-bottom: 14px; }
.hero .goal { font-size: .97rem; color: var(--ink2); margin-bottom: 18px; }
.hero .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- ١٣. شريط التقدّم: ١٤ شريحة ---------- */

.progress { margin-bottom: 30px; }
.progress .head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .85rem; color: var(--ink2); margin-bottom: 8px; gap: 12px;
}
.progress .bar { display: flex; gap: 3px; }
.progress .seg {
  flex: 1 1 0; height: 8px; border-radius: var(--r);
  background: var(--rule);
}
.progress .seg.done    { background: var(--teal); }
.progress .seg.current { background: var(--amber-line); }

/* ---------- ١٤. لوحة الإحصاء ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 30px; }
.stat {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 14px 16px;
}
.stat .k { font-size: .78rem; color: var(--ink3); line-height: 1.7; }
.stat .v { font-family: var(--display); font-weight: 700; font-size: 1.55rem; line-height: 1.4; }
.stat .n { font-size: .78rem; color: var(--ink2); line-height: 1.7; }
.stat .v.low  { color: var(--miss); }
.stat .v.mid  { color: #8a6410; }
.stat .v.high { color: var(--good); }

/* ---------- ١٥. شبكة الجلسات ---------- */

.grid { display: flex; flex-direction: column; gap: 8px; margin-bottom: 34px; }
.card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 13px 16px;
  color: inherit;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  width: 100%;
  font: inherit;
  cursor: pointer;
}
.card:hover { border-color: var(--ink3); }
.card.is-done { background: var(--good-soft); border-color: #c6ddcd; }
.card.is-today { border-color: var(--amber-line); background: var(--amber-soft); }
.card .num {
  font-family: var(--display); font-weight: 700; font-size: 1.3rem;
  color: var(--ink3); text-align: center; line-height: 1.3;
}
.card.is-done .num { color: var(--good); }
.card .t { font-weight: 500; font-size: 1rem; line-height: 1.65; }
.card .t .en { font-weight: 400; font-size: .84em; color: var(--ink3); }
.card .m { font-size: .78rem; color: var(--ink2); line-height: 1.8; }
.card .right { text-align: center; font-size: .78rem; color: var(--ink2); line-height: 1.7; min-width: 74px; }
.card .score { font-family: var(--display); font-weight: 700; font-size: 1.05rem; display: block; }
.card .score.low  { color: var(--miss); }
.card .score.mid  { color: #8a6410; }
.card .score.high { color: var(--good); }

/* ---------- ١٦. أقسام النص الثابت ---------- */

.note {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 20px 22px; margin-bottom: 16px;
}
.note h3 { margin-top: 0; }
.note p:last-child, .note ul:last-child, .note ol:last-child { margin-bottom: 0; }

/* ---------- ١٧. عارض الجلسة: الترويسة والفهرس ---------- */

.s-head { margin-bottom: 26px; }
.s-head .eyebrow { font-size: .8rem; color: var(--teal); font-weight: 500; line-height: 1.8; }
.s-head h1 { margin-bottom: .1em; }
.s-head .title-en {
  font-family: var(--sans); font-size: .92rem; color: var(--ink3);
  direction: ltr; unicode-bidi: isolate; text-align: right; margin-bottom: 10px; line-height: 1.7;
}
.s-head .meta { font-size: .85rem; color: var(--ink2); line-height: 1.9; }

.goal-box {
  background: var(--teal-soft); border: 1px solid #bcd7d1; border-radius: var(--r);
  padding: 16px 18px; margin: 22px 0 28px;
}
.goal-box .k { font-size: .78rem; font-weight: 500; color: var(--teal); line-height: 1.8; }
.goal-box .v { font-size: 1.02rem; margin: 0; }

.toc {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 16px 20px; margin-bottom: 34px;
}
.toc .k { font-size: .78rem; font-weight: 500; color: var(--ink3); line-height: 1.8; margin-bottom: 4px; }
.toc ol { margin: 0; padding-inline-start: 1.5em; }
.toc li { margin-bottom: .1em; }
.toc a { border-bottom: none; color: var(--ink2); }
.toc a:hover { color: var(--teal); border-bottom: 1px solid var(--teal-soft); }

/* ---------- ١٨. كتل المحتوى ---------- */

.sec { margin-bottom: 44px; }
.sec > h2 { scroll-margin-top: 16px; }
.sec h2 .en {
  display: block; font-family: var(--sans); font-weight: 400;
  font-size: .8rem; color: var(--ink3); line-height: 1.7; margin-top: 2px;
}

/* الصناديق الثلاثة */
.box { border-radius: var(--r); padding: 15px 18px; margin: 0 0 1.3em; }
.box .bt { font-weight: 700; font-size: .93rem; line-height: 1.8; margin-bottom: 2px; }
.box p:last-child, .box ul:last-child, .box ol:last-child { margin-bottom: 0; }
.box.key  { background: var(--teal-soft); border: 1px solid #bcd7d1; }
.box.key  .bt { color: var(--teal); }
.box.warn { background: var(--amber-soft); border: 1px solid var(--amber-line); }
.box.warn .bt { color: #8a6410; }
.box.ex   { background: var(--good-soft); border: 1px solid #c6ddcd; }
.box.ex   .bt { color: var(--good); }

/* كتل الكود */
.code-wrap { margin: 0 0 1.4em; }
.code-wrap .lang {
  font-family: var(--mono); font-size: .72rem; color: var(--ink3);
  direction: ltr; text-align: left; line-height: 1.8; margin-bottom: 3px;
}
pre.code {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 14px 16px;
  margin: 0;
  overflow-x: auto;
  font-size: .84rem;
  line-height: 1.75;
  tab-size: 4;
}

/* الجداول */
.table-wrap { margin: 0 0 1.5em; }
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .88rem; line-height: 1.75; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--rule); text-align: right; vertical-align: top; }
thead th {
  background: var(--paper); font-weight: 500; font-size: .84rem;
  color: var(--ink); border-bottom: 1px solid var(--rule); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
/* العمود الأول ثابت الخلفية */
tbody td:first-child { background: var(--paper); font-weight: 500; }
.table-hint { font-size: .76rem; color: var(--ink3); line-height: 1.8; margin-top: 4px; }
@media (min-width: 640px) { .table-hint { display: none; } }

/* الرسوم */
.fig { margin: 0 0 1.6em; }
.fig svg { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.fig figcaption { font-size: .78rem; color: var(--ink3); line-height: 1.8; margin-top: 6px; text-align: center; }

/* بطاقة خطأ كتلة */
.block-error {
  background: var(--miss-soft); border: 1px solid #e2b6b1; border-radius: var(--r);
  padding: 10px 14px; font-size: .84rem; color: var(--miss); margin-bottom: 1.2em;
}

/* ---------- ١٩. المسرد ---------- */

.glossary dl { margin: 0; }
.glossary .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
}
.glossary .row:last-child { border-bottom: none; }
.glossary dt { font-weight: 500; font-size: .95rem; line-height: 1.8; }
.glossary dd {
  margin: 0; direction: ltr; unicode-bidi: isolate; text-align: left;
  font-size: .9rem; color: var(--ink2); line-height: 1.8;
}
.glossary .note-txt { grid-column: 1 / -1; font-size: .84rem; color: var(--ink3); line-height: 1.85; }

/* ---------- ٢٠. التمرين والمصادر ---------- */

.exercise .parts { display: flex; flex-direction: column; gap: 12px; }
.exercise .part {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 14px 16px; display: grid; grid-template-columns: 30px 1fr; gap: 12px;
}
.exercise .lab {
  font-family: var(--display); font-weight: 700; font-size: 1.1rem;
  color: var(--teal); text-align: center; line-height: 1.7;
}
.exercise .part p:last-child, .exercise .part ul:last-child, .exercise .part ol:last-child { margin-bottom: 0; }

.resources .res { padding: 11px 0; border-bottom: 1px solid var(--rule); }
.resources .res:last-child { border-bottom: none; }
.resources .rt { font-weight: 500; font-size: .97rem; line-height: 1.8; }
.resources .rn { font-size: .78rem; color: var(--ink3); line-height: 1.8; }
.resources .rw { font-size: .87rem; color: var(--ink2); line-height: 1.85; }

/* ---------- ٢١. الاختبار ---------- */

.quiz .q {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 14px;
}
.quiz .qh {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.quiz .qn {
  font-family: var(--display); font-weight: 700; font-size: 1rem; color: var(--ink3);
  line-height: 1.7;
}
.quiz .lvl {
  font-size: .72rem; font-weight: 500; line-height: 1.7; padding: .05em .6em;
  border-radius: var(--r); border: 1px solid; white-space: nowrap;
}
.quiz .lvl.l1 { background: var(--paper);     border-color: var(--ink3);      color: var(--ink2); }
.quiz .lvl.l2 { background: var(--amber-soft); border-color: var(--amber-line); color: #8a6410; }
.quiz .lvl.l3 { background: var(--teal-soft);  border-color: var(--teal);       color: var(--teal); }
.quiz .qdom {
  font-size: .72rem; font-weight: 500; line-height: 1.7; padding: .05em .6em;
  border-radius: var(--r); border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink2); white-space: nowrap;
}
.quiz .qt { font-size: 1rem; margin-bottom: 12px; }

.quiz .opts { display: flex; flex-direction: column; gap: 7px; }
.quiz .opt {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 10px 13px; font: inherit; font-size: .95rem; line-height: 1.8;
  text-align: right; color: inherit; cursor: pointer; width: 100%;
}
.quiz .opt:hover:not(:disabled) { border-color: var(--ink3); background: var(--paper); }
.quiz .opt .ol {
  font-family: var(--display); font-weight: 700; font-size: .95rem;
  color: var(--ink3); text-align: center; line-height: 1.85;
}
.quiz .opt:disabled { cursor: default; }
.quiz .opt.correct { background: var(--good-soft); border-color: var(--good); }
.quiz .opt.correct .ol { color: var(--good); }
.quiz .opt.chosen-wrong { background: var(--miss-soft); border-color: var(--miss); }
.quiz .opt.chosen-wrong .ol { color: var(--miss); }
.quiz .opt .verdict { font-size: .78rem; font-weight: 500; display: block; }
.quiz .opt.correct .verdict { color: var(--good); }
.quiz .opt.chosen-wrong .verdict { color: var(--miss); }

.quiz .exp {
  margin-top: 12px; padding: 13px 16px; border-radius: var(--r);
  background: var(--paper); border: 1px solid var(--rule); font-size: .93rem; line-height: 1.9;
}
.quiz .exp .k { font-weight: 700; font-size: .82rem; color: var(--ink3); line-height: 1.8; }
.quiz .exp p:last-child { margin-bottom: 0; }

.quiz-summary {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 18px 20px; margin-bottom: 18px;
}
.quiz-summary .v { font-family: var(--display); font-weight: 900; font-size: 1.8rem; line-height: 1.4; }
.quiz-summary .tiers { font-size: .85rem; color: var(--ink2); line-height: 1.95; }

/* ---------- ٢٢. التنقّل بين الجلسات ---------- */

.s-nav {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  border-top: 1px solid var(--rule); padding-top: 22px; margin-top: 40px;
}
.s-nav .sp { flex: 1 1 auto; }

.done-strip {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 14px 18px; margin: 30px 0 0;
}
.done-strip.is-done { background: var(--good-soft); border-color: #c6ddcd; }
.done-strip .status { font-size: .9rem; font-weight: 500; }
.done-strip.is-done .status { color: var(--good); }

/* ---------- ٢٣. المحاكاة الموقوتة ---------- */

.timer {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 10px 16px; margin-bottom: 16px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  font-size: .88rem;
}
.timer .clock { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; direction: ltr; }
.timer.low .clock { color: var(--miss); }

/* ---------- ٢٤. الحركة: فقط استجابةً لفعل المستخدم ---------- */

@media (prefers-reduced-motion: no-preference) {
  .quiz .exp { animation: reveal .18s ease-out; }
  @keyframes reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
}

/* ---------- ٢٥. الجوال: ٣٧٥ بكسل بلا تمرير أفقي ---------- */

@media (max-width: 560px) {
  html { font-size: 16px; }
  .wrap { padding-inline: 14px; }
  h1 { font-size: 1.5rem; }
  .hero { padding: 20px 16px; }
  .hero h1 { font-size: 1.4rem; }
  .card { grid-template-columns: 34px 1fr; row-gap: 6px; padding: 12px 14px; }
  .card .right { grid-column: 1 / -1; text-align: right; min-width: 0; }
  .card .score { display: inline; }
  .glossary .row { grid-template-columns: 1fr; }
  .exercise .part { grid-template-columns: 24px 1fr; gap: 8px; }
  .quiz .q { padding: 15px 14px; }
  .quiz .opt { padding: 9px 11px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

@media print {
  .site-head nav, .s-nav, .done-strip, .toc, .timer { display: none; }
  body { background: #fff; }
}

/* ---------- ٢٦. صفحة الترحيب ---------- */

.welcome {
  max-width: 620px;
  margin-inline: auto;
  padding-block: 40px 24px;
  text-align: center;
}
.welcome .hi {
  font-family: var(--display);
  font-weight: 900;
  font-size: 3.1rem;
  color: var(--teal);
  margin-bottom: .35em;
  line-height: 1.25;
}
.welcome .lead {
  font-size: 1.12rem;
  line-height: 2.05;
  color: var(--ink);
  margin-bottom: 1em;
  text-align: center;
}
.welcome .lead:last-of-type { color: var(--ink2); }

/* أرقام تعريفية موجزة */
.welcome .wfacts {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 30px 0 32px;
}
.welcome .wfact {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 14px 22px;
  min-width: 104px;
}
.welcome .wfact .n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--teal);
  line-height: 1.35;
}
.welcome .wfact .l {
  font-size: .8rem;
  color: var(--ink3);
  line-height: 1.7;
}

.welcome .wactions { display: flex; justify-content: center; margin-bottom: 8px; }
button.big { font-size: 1.05rem; padding: .72em 2.4em; }

.welcome .rule {
  height: 1px;
  background: var(--rule);
  margin: 34px auto 22px;
  max-width: 220px;
}

.welcome .sig { margin-top: 4px; }
.made {
  font-size: .95rem;
  color: var(--ink2);
  line-height: 1.9;
  margin-bottom: 12px;
}

/* روابط التواصل */
.social {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.social .soc {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: .42em .95em;
  color: var(--ink2);
  background: var(--surface);
  font-size: .88rem;
  line-height: 1.7;
  text-decoration: none;
}
.social .soc span { direction: ltr; unicode-bidi: isolate; }
.social .soc svg { flex: none; }
.social .soc:hover { border-color: var(--teal); color: var(--teal); }

/* بطاقة «عن هذا الموقع» في الغلاف */
.note.about { text-align: center; }
.note.about .wactions { display: flex; justify-content: center; margin-top: 14px; }

@media (max-width: 560px) {
  .welcome { padding-block: 26px 18px; }
  .welcome .hi { font-size: 2.4rem; }
  .welcome .lead { font-size: 1.04rem; }
  .welcome .wfact { padding: 12px 16px; min-width: 92px; }
}

/* ---------- ٢٧. امتداد أطراف الحروف (swsh) ---------- */
/* خط ثمانية يوفّر أطرافاً ممتدّة للحروف المنتهية.
   تُطبَّق على السياقات العرضية — العناوين وصفحة الترحيب — لا على
   نصّ المتن الطويل، لأن الامتداد الزخرفي يبطئ القراءة في الفقرات. */

h1, h2,
.hero h1, .hero .eyebrow,
.s-head h1, .sec > h2,
.stat .v, .card .num, .quiz-summary .v,
.welcome .hi, .welcome .lead, .welcome .wfact .n,
.welcome .made, .note.about .made,
button.big {
  font-feature-settings: "swsh" 1;
}

/* التذييل الرسمي يظهر في كل الصفحات عدا الترحيب —
   لأن صفحة الترحيب تحمل توقيعها الشخصي الخاص */
body.is-welcome .site-foot { display: none; }

/* ملاحظة الصدق في صفحة الترحيب — نبرة هادئة لا تحذيرية */
.welcome .wnote {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 15px 20px;
  margin: 0 auto 30px;
  max-width: 520px;
  font-size: .92rem;
  line-height: 1.95;
  color: var(--ink2);
  text-align: right;
  font-feature-settings: normal;   /* بلا امتداد: نصّ يُقرأ لا يُزيَّن */
}
.welcome .wnote strong { color: var(--ink); font-weight: 700; }
