/* الصفحة الرئيسية: ورق دفتر مسطّر بهامش وردي، وعلامات الشكل (◌َ ◌ُ ◌ِ) هي الزخرفة الوحيدة */
.pub-main:has(.hm-hero) { padding-top: 0; }
:root { --ink: #1B2A5E; --rule: #D9E3F7; --margin: #F2A7B5; --sun: #FFB020; --leaf: #1E9E6A; --sky: #EAF1FF; }

.hm-hero { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 56px 0 64px; isolation: isolate; }
.hm-paper { --m: max(6px, calc(50vw - 572px)); position: absolute; inset: 0 calc(50% - 50vw); z-index: -1; background:
    linear-gradient(to left, transparent 0 var(--m), var(--margin) var(--m) calc(var(--m) + 2px), transparent calc(var(--m) + 2px)),
    repeating-linear-gradient(to bottom, #fff 0 39px, var(--rule) 39px 40px); border-bottom: 1px solid var(--rule); }
.hm-word { font-family: "Naskh", serif; font-weight: 700; font-size: clamp(88px, 14vw, 168px); line-height: 1.15; margin: 0 0 4px; color: var(--ink); }
.hm-hero h1 { font-family: "Naskh", serif; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.45; margin: 0 0 12px; color: var(--ink); max-width: 20ch; }
.hm-lead { font-size: 18px; color: #3B4670; max-width: 46ch; margin: 0 0 24px; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hm-btn { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; padding: 14px 22px; border-radius: 16px; }
.hm-btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--ink); padding: 12px 20px; }
.hm-btn:hover { background: #24387C; }
.hm-btn.ghost:hover { background: var(--sky); }
.hm-btn:focus-visible, .hm-tier:focus-visible, .hm-faq summary:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* بطاقة من درس حقيقي: الكلمة ومعناها تحتها، وسؤال مصحَّح */
.hm-card { position: relative; margin: 0; background: #fff; border: 2px solid var(--ink); border-radius: 28px; padding: 22px 22px 18px; box-shadow: 10px 10px 0 var(--sun); transform: rotate(-1.5deg); }
.hm-card-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; color: #6B7495; }
.hm-stars { color: var(--sun); letter-spacing: 2px; } .hm-stars i { font-style: normal; color: #E6E0CF; }
.hm-card-word { font-family: "Naskh", serif; font-size: 64px; font-weight: 700; text-align: center; color: var(--ink); line-height: 1.6; margin-top: 6px; }
.hm-card-mean { font-family: "Naskh", serif; text-align: center; font-size: 19px; color: var(--leaf); border-top: 2px dashed var(--rule); padding-top: 8px; margin: 0 24px 16px; }
.hm-card-q { background: var(--sky); border-radius: 18px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hm-card-q p { flex-basis: 100%; margin: 0 0 2px; font-family: "Naskh", serif; font-size: 19px; font-weight: 700; }
.hm-card-q span { font-family: "Naskh", serif; background: #fff; border: 2px solid var(--rule); border-radius: 12px; padding: 2px 12px; font-size: 18px; }
.hm-card-q .ok { border-color: var(--leaf); color: var(--leaf); font-weight: 700; }
.hm-sound { position: absolute; top: -18px; left: -14px; width: 48px; height: 48px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; font-size: 22px; border: 2px solid var(--ink); }
.hm-card figcaption { font-size: 13px; color: #6B7495; text-align: center; margin-top: 12px; }

/* علامات الشكل: تسقط في مكانها مرة واحدة عند فتح الصفحة */
.hm-mark { position: absolute; font-family: "Naskh", serif; font-size: 64px; line-height: 1; pointer-events: none; z-index: -1; animation: hm-drop .9s cubic-bezier(.2,.9,.3,1.3) both; }
.hm-mark.m1 { color: var(--sun); top: 26px; left: 46%; animation-delay: .15s; }
.hm-mark.m2 { color: var(--leaf); bottom: 30px; left: 41%; animation-delay: .3s; }
.hm-mark.m3 { color: var(--margin); top: 44%; left: 2%; animation-delay: .45s; }
.hm-mark.m5 { color: var(--sun); bottom: 12px; left: 8%; animation-delay: .75s; }
@keyframes hm-drop { from { opacity: 0; transform: translateY(-40px) rotate(-20deg); } }
@media (prefers-reduced-motion: reduce) { .hm-mark { animation: none; } }

section[class^="hm-"]:not(.hm-hero) { margin-top: 64px; }
section h2 { font-family: "Naskh", serif; font-size: 30px; line-height: 1.5; color: var(--ink); margin: 0 0 18px; }

/* المحطات: تسلسل حقيقي في الدرس، فالأسهم بينها */
.hm-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.hm-steps li { position: relative; background: #fff; border-radius: 20px; padding: 16px 18px; border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; }
.hm-steps li:not(:last-child)::after { content: "←"; position: absolute; left: -15px; top: 50%; transform: translate(-50%, -50%); color: var(--sun); font-size: 22px; font-weight: 700; }
.hm-steps b { font-family: "Naskh", serif; font-size: 26px; color: var(--ink); }
.hm-steps span { color: #4A5378; font-size: 15px; }

/* الصفوف: لكل صف شكله من محتواه */
.hm-grade-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.hm-grade { background: #fff; border-radius: 24px; padding: 20px; border: 1px solid var(--rule); }
.hm-grade header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hm-grade-n { font-family: "Naskh", serif; font-size: 44px; font-weight: 700; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--sky); color: var(--ink); line-height: 1; }
.hm-grade.g1 .hm-grade-n { background: #FFF0C9; } .hm-grade.g2 .hm-grade-n { background: #DDF3E8; }
.hm-grade h3 { font-family: "Naskh", serif; font-size: 24px; margin: 0; color: var(--ink); }
.hm-grade p { margin: 0 0 10px; color: #3B4670; }
.hm-abjad { font-family: "Naskh", serif; font-size: 26px; line-height: 1.9; color: var(--ink); word-spacing: 8px; }
.hm-units { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.hm-units li { background: #F2F8F4; color: #17734F; border-radius: 999px; padding: 3px 12px; font-size: 14.5px; }
.hm-soon { color: #6B7495; }
.hm-grade.g3 .hm-grade-n { background: #FFE3E8; }
.hm-grade.gb .hm-grade-n { background: #EDE7FB; color: #4B2C9E; }
.hm-grade.gb a { color: #4B2C9E; font-weight: 700; }

/* ما يجده الأهل: الشريط الداكن الوحيد في الصفحة */
.hm-why { background: var(--ink); color: #fff; border-radius: 32px; padding: 32px 28px; }
.hm-why h2 { color: #fff; }
.hm-why dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
.hm-why dt { font-family: "Naskh", serif; font-size: 21px; font-weight: 700; color: var(--sun); }
.hm-why dd { margin: 2px 0 0; color: #D7DEF5; max-width: 52ch; }

.hm-sub { color: #3B4670; margin: -8px 0 16px; }
.hm-tiers { display: flex; flex-wrap: wrap; gap: 12px; }
.hm-tier { flex: 1 1 200px; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.hm-tier:nth-child(2) { box-shadow: 6px 6px 0 var(--sun); }
.hm-tier:hover { background: var(--sky); }
.hm-tier-n { font-weight: 700; color: #4A5378; }
.hm-tier-p b { font-family: "Naskh", serif; font-size: 40px; line-height: 1.3; }
.hm-note { color: #4A5378; font-size: 15px; margin: 14px 0 0; }

.hm-blog-head { display: flex; justify-content: space-between; align-items: baseline; }

.hm-faq details { background: #fff; border: 1px solid var(--rule); border-radius: 16px; padding: 0 18px; margin-bottom: 10px; max-width: 760px; }
.hm-faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; color: var(--ink); }
.hm-faq details[open] summary { color: var(--leaf); }
.hm-faq details p { margin: 0 0 14px; color: #3B4670; }

.hm-end { text-align: center; padding: 20px 0 10px; }
.hm-end-word { font-family: "Naskh", serif; font-size: clamp(48px, 8vw, 84px); color: var(--ink); margin: 0 0 14px; line-height: 1.4; }

/* مقياس أديب: رسم صغير لنموّ الدرجة عبر العام */
.hm-scale { display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; }
.hm-scale-text p { color: #3B4670; max-width: 60ch; margin: -6px 0 12px; }
.hm-scale ul { margin: 0; padding: 0 20px 0 0; color: #3B4670; max-width: 62ch; }
.hm-scale li { margin-bottom: 8px; }
.hm-scale li b { color: var(--ink); }
.hm-scale-fig { margin: 0; background: #fff; border: 2px solid var(--ink); border-radius: 28px; padding: 16px 14px 10px; }
.hm-scale-fig svg { width: 100%; height: auto; display: block; font-family: Tahoma, sans-serif; }
.hm-scale-fig .band rect { fill: #DDF3E8; }
.hm-scale-fig .band-t { fill: #17734F; font-size: 12px; }
.hm-scale-fig .axis { stroke: var(--rule); stroke-width: 2; }
.hm-scale-fig .line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hm-scale-fig .dot { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.hm-scale-fig .dot.last { fill: var(--sun); }
.hm-scale-fig .v { fill: var(--ink); font-weight: 700; font-size: 15px; }
.hm-scale-fig .w { fill: #6B7495; font-size: 12px; }
.hm-scale-fig figcaption { text-align: center; font-size: 13px; color: #6B7495; }

/* الصور */
.hm-art { position: relative; }
.hm-hero-img { display: block; width: 100%; height: auto; border-radius: 32px; border: 2px solid var(--ink); }
.hm-art { margin-bottom: 70px; }
.hm-art .hm-card { position: absolute; width: 50%; right: -18px; bottom: -96px; padding: 14px 14px 10px; transform: rotate(1.5deg); }
.hm-art .hm-card-word { font-size: 46px; }
.hm-art .hm-card-mean { font-size: 16px; margin: 0 10px 10px; }
.hm-art .hm-card-q p, .hm-art .hm-card-q span { font-size: 15px; }
.hm-art .hm-card figcaption { display: none; }
.hm-steps img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 14px; margin-bottom: 8px; }
.hm-scale-art { position: relative; }
.hm-scale-art > img { display: block; width: 100%; height: auto; border-radius: 28px; }
.hm-scale-art .hm-scale-fig { position: relative; width: 78%; margin: -28px auto 0; padding: 8px 8px 4px; }
.hm-scale-art figcaption { font-size: 11px; }
.hm-why-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 28px; align-items: center; }
.hm-why-grid img { width: 100%; height: auto; border-radius: 22px; display: block; }
.hm-schools { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; align-items: center; margin-top: 28px; background: #fff; border: 1px solid var(--rule); border-radius: 28px; padding: 14px; }
.hm-schools img { width: 100%; height: auto; border-radius: 20px; display: block; }
.hm-schools h3 { font-family: "Naskh", serif; font-size: 26px; margin: 0 0 6px; color: var(--ink); }
.hm-schools p { margin: 0 0 8px; color: #3B4670; max-width: 52ch; }
.hm-end-img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: cover; border-radius: 32px; margin-bottom: 18px; }

@media (max-width: 860px) {
    .hm-art { margin-bottom: 0; }
    .hm-art .hm-card { position: relative; width: auto; right: auto; bottom: auto; margin: -40px 12px 0; }
    .hm-scale-art .hm-scale-fig { position: relative; width: auto; right: auto; bottom: auto; margin: -30px 12px 0; }
    .hm-why-grid, .hm-schools { grid-template-columns: 1fr; }
    .hm-scale { grid-template-columns: 1fr; }
    .hm-hero { grid-template-columns: 1fr; padding-top: 32px; }
    .hm-card { transform: none; max-width: 440px; }
    .hm-steps { grid-template-columns: 1fr 1fr; }
    .hm-steps li::after { display: none; }
    .hm-grade-row { grid-template-columns: 1fr; }
    .hm-why dl { grid-template-columns: 1fr; }
    .hm-mark.m1, .hm-mark.m2 { display: none; }
}
@media (max-width: 480px) { .hm-steps { grid-template-columns: 1fr 1fr; gap: 10px; } .hm-steps li { padding: 10px; } .hm-steps b { font-size: 22px; } .hm-steps span { font-size: 13.5px; } .hm-why { padding: 24px 18px; } }
.hm-course { margin: 0 0 22px; font-size: 1.05rem; } .hm-course b { font-size: 1.3rem; }

/* البداية: زرّ ثانٍ مضيء، وسطر الاشتراك والدخول */
.hm-btn.sun { background: var(--sun); color: var(--ink); }
.hm-btn.sun:hover { filter: brightness(1.05); }
.hm-btn span[lang=en] { font-weight: 400; font-size: 14px; opacity: .85; }
.hm-hero-sub { margin: 12px 0 0; font-size: 15px; color: #3B4670; }
.hm-hero-sub a { color: var(--ink); }

/* العربية للناطقين بغيرها */
.hm-ab { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; background: #F6F2FF; border-radius: 32px; padding: 30px 28px; }
.hm-ab-kicker { margin: 0 0 4px; color: #4B2C9E; font-weight: 700; letter-spacing: .3px; text-align: right; }
.hm-ab-text > p { color: #3B4670; max-width: 60ch; margin: -6px 0 14px; }
.hm-ab ul { margin: 0 0 18px; padding: 0 20px 0 0; color: #3B4670; max-width: 62ch; }
.hm-ab li { margin-bottom: 8px; } .hm-ab li b { color: var(--ink); }
.hm-ab-levels { list-style: none; margin: 0 0 16px; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.hm-ab-levels li { background: #fff; border: 2px solid #DCD3F2; border-radius: 16px; padding: 8px 14px; display: flex; gap: 8px; align-items: baseline; margin: 0; }
.hm-ab-levels b { font-family: "Naskh", serif; font-size: 22px; color: #4B2C9E; }
.hm-ab-levels span { color: var(--ink); font-weight: 700; }
.hm-ab-art { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hm-ab-art img { width: 100%; height: auto; border-radius: 22px; display: block; }
.hm-ab-art img:first-child { grid-column: 1 / -1; }
.hm-ab-line { margin: -40px 16px 0; grid-column: 1 / -1; position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 22px; padding: 12px 16px 8px; box-shadow: 8px 8px 0 var(--sun); transform: rotate(-1deg); }
.hm-ab-line p { font-family: "Naskh", serif; font-size: 20px; margin: 0; color: var(--ink); }
.hm-ab-line b { color: #4B2C9E; }
.hm-ab-line figcaption { font-size: 13px; color: #6B7495; margin-top: 4px; }
@media (max-width: 860px) { .hm-ab { grid-template-columns: 1fr; padding: 24px 18px; } }

/* الخلفية المسطّرة تمتدّ بعرض الشاشة (100vw يشمل شريط التمرير): لا تمرير أفقي */
html, body { overflow-x: clip; }

/* الإنجليزية والفرنسية: الصفحة من اليسار إلى اليمين، والأمثلة العربية تبقى من اليمين */
[dir=ltr] .hm-sound { left: auto; right: -14px; }
[dir=ltr] .hm-steps li:not(:last-child)::after { content: "→"; left: auto; right: -15px; transform: translate(50%, -50%); }
[dir=ltr] .hm-card { transform: rotate(1.5deg); }
[dir=ltr] h1, [dir=ltr] h2, [dir=ltr] h3 { font-family: Georgia, "Times New Roman", serif; }
[dir=ltr] .hm-word, [dir=ltr] .hm-end-word, [dir=ltr] .hm-card-word, [dir=ltr] .hm-card-mean { font-family: "Naskh", serif; }
.hm-tr { display: block; font-family: "Segoe UI", system-ui, sans-serif; font-size: 13px; color: #6B7495; font-weight: 400; margin-top: 2px; }
@media (min-width: 861px) { [dir=ltr] .hm-art .hm-card { right: auto; left: -18px; } }
.hm-paynote { background: #FFF6DD; border: 1px solid #F2DFA6; border-radius: 16px; padding: 10px 14px; margin: 0 0 16px; color: #5A4300; }
.hm-paynote a { font-weight: 700; }
.hm-abjad .soon { opacity: .28; }
.hm-ready { font-size: 14px; color: #3B4670; background: #F1F4FB; border-radius: 12px; padding: 6px 10px; margin: 8px 0 0; }
