/* ===== لخّصتهالك — Home redesign «كراسة الإعراب» ===== */
@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&family=Readex+Pro:wght@400;600;700&display=swap');
@font-face { font-family: 'KhLama'; src: url('../fonts/LamaSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'KhLama'; src: url('../fonts/LamaSans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'KhRuqaa'; src: url('../fonts/THARWATEMARARUQAALIGHT.woff2') format('woff2'); font-display: swap; }

body.kh-home {
  --paper: #F3EDE2; --card: #FBF8F2; --ink: #16120F; --muted: #5E554C; --line: rgba(22,18,15,.16); --or: #FF7A00;
  background: var(--paper) !important; color: var(--ink);
  font-family: 'KhLama', 'Readex Pro', sans-serif; overflow-x: hidden; user-select: auto; text-align: start;
}
body.kh-home.dark { --paper: #121010; --card: #1C1917; --ink: #F3EDE2; --muted: #A99E92; --line: rgba(243,237,226,.16); }
body.kh-home::after { display: none; }
body.kh-home a { color: inherit; text-decoration: none; }
body.kh-home a:hover { color: var(--or); }
body.kh-home img { max-width: 100%; }
.kh-wrap { text-align: right; max-width: 1280px; margin: 0 auto; padding: 0 24px; position: relative; }
.kh-display { font-family: 'Aref Ruqaa', 'KhRuqaa', serif; font-weight: 700; }
.kh-h2 { margin: 0; font-family: 'Aref Ruqaa', 'KhRuqaa', serif; font-weight: 700; font-size: clamp(44px, 6vw, 80px); line-height: 1.25; color: var(--ink); }
.kh-h2 em { font-style: normal; color: var(--or); }
.kh-headrow { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.kh-headrow small { font-size: 14px; color: var(--muted); }

/* الناف بار والفوتر اتنقلوا لـ css/layout.css */

/* ===== Animations ===== */
@keyframes khDrift { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-16px) rotate(6deg); } }
@keyframes khRise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes khSweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes khTag { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes khSpin { to { transform: rotate(360deg); } }
@keyframes khTicker { to { transform: translateX(50%); } }

/* ===== Hero ===== */
.kh-hero { padding: 56px 0 40px; overflow-x: clip; }
.kh-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 24px; align-items: center; }
.kh-hero-copy { display: flex; flex-direction: column; gap: 30px; animation: khRise .9s cubic-bezier(.2,.8,.2,1) both; }
.kh-kicker { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
.kh-kicker::before { content: ""; width: 34px; height: 2px; background: var(--or); }
.kh-parse { display: flex; flex-direction: column; gap: 4px; }
.kh-word { display: flex; flex-direction: column; align-items: flex-start; text-align: start; }
.kh-word b { position: relative; font-family: 'Aref Ruqaa', 'KhRuqaa', serif; font-weight: 700; font-size: clamp(64px, 12vw, 168px); line-height: 1.4; color: var(--ink); }
.kh-word.or b { color: var(--or); }
.kh-word.or b::after { content: ""; position: absolute; right: 0; left: 0; bottom: -2px; height: 5px; background: var(--ink); transform-origin: right; animation: khSweep .8s cubic-bezier(.7,0,.2,1) .5s both; }
.kh-word span { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: var(--muted); animation: khTag .6s ease .9s both; }
.kh-word.or span { animation-delay: 1.2s; }
.kh-word span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--or); }
.kh-word.or span::before { background: var(--ink); }
.kh-lead { margin: 0; max-width: 520px; text-align: start; font-size: 18px; line-height: 2; color: var(--ink); text-wrap: pretty; }
.kh-lead span { color: var(--muted); }
.kh-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.kh-btn { display: inline-flex; align-items: center; gap: 14px; padding: 17px 30px; font-weight: 700; font-size: 16px; transition: gap .3s, background .3s, border-color .3s; }
.kh-btn-ink { background: var(--ink); color: var(--paper) !important; }
.kh-btn-ink:hover { gap: 24px; color: var(--or) !important; }
.kh-btn-line { border: 1.5px solid var(--line); }
.kh-btn-line:hover { border-color: var(--ink); color: var(--ink) !important; }
.kh-visual { position: relative; display: grid; place-items: center; min-height: 540px; animation: khRise 1s cubic-bezier(.2,.8,.2,1) .2s both; }
.kh-visual::before { content: ""; position: absolute; width: min(92%, 520px); aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed var(--line); animation: khSpin 60s linear infinite; }
.kh-ghost { position: absolute; top: 4%; left: 50%; transform: translateX(-50%); font-family: 'Aref Ruqaa', serif; font-size: clamp(200px, 30vw, 380px); line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--line); pointer-events: none; user-select: none; }
.kh-visual img { position: relative; width: min(100%, 520px); height: auto; display: block; }
.kh-mark { position: absolute; font-family: 'Aref Ruqaa', serif; font-size: clamp(56px, 9vw, 130px) !important; line-height: 1; direction: rtl; unicode-bidi: isolate; animation: khDrift 6s ease-in-out infinite; pointer-events: none; }
.kh-mark.m1 { top: 14%; inset-inline-start: 8%; color: var(--or); }
.kh-mark.m2 { top: 40%; inset-inline-end: 4%; color: var(--ink); animation-duration: 7s; animation-delay: 1s; }
.kh-mark.m3 { bottom: 16%; inset-inline-start: 2%; color: var(--ink); animation-duration: 5.5s; animation-delay: .6s; }
.kh-mark.m4 { bottom: 6%; inset-inline-end: 16%; color: var(--or); animation-duration: 6.5s; animation-delay: 1.6s; }
@media (max-width: 767px) {
  .kh-hero { padding-top: 30px; }
  .kh-visual { min-height: 380px; order: -1; }
  .kh-mark { font-size: clamp(40px, 12vw, 64px) !important; }
  .kh-mark.m1, .kh-mark.m3 { inset-inline-start: 4%; }
  .kh-mark.m2, .kh-mark.m4 { inset-inline-end: 4%; }
  .kh-ghost { font-size: clamp(150px, 48vw, 220px); }
  .kh-lead { font-size: 16px; }
  .kh-btn { flex: 1 1 auto; justify-content: center; }
}

/* ===== Why ===== */
.kh-why { padding: 60px 0 90px; }
.kh-reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.kh-reason { padding: 30px 26px 34px; text-align: right; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; transition: background .35s, color .35s; }
.kh-reason:hover { background: var(--or); color: #16120F; }
.kh-reason i { font-family: 'Aref Ruqaa', serif; font-style: normal; font-weight: 700; font-size: 46px; line-height: 1; color: var(--or); }
.kh-reason:hover i { color: #16120F; }
.kh-reason h3 { margin: 0; font-family: 'KhLama', sans-serif; font-size: 21px; font-weight: 700; color: inherit; }
.kh-reason p { margin: 0; font-size: 15px; line-height: 1.9; opacity: .8; }

/* ===== Stages ===== */
.kh-stages { background: #16120F; color: #F3EDE2; padding: 90px 0; }
body.dark .kh-stages { background: #000; }
.kh-stages .kh-h2 { color: #F3EDE2; }
.kh-stages .kh-uline::after { background: #F3EDE2; }
.kh-stages-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.kh-tabs { display: flex; border: 1.5px solid rgba(243,237,226,.3); }
.kh-tabs button { border: 0; cursor: pointer; padding: 14px 26px; font-family: 'KhLama', sans-serif; font-weight: 700; font-size: 15px; background: transparent; color: #F3EDE2; transition: background .3s, color .3s; }
.kh-tabs button.on { background: #FF7A00; color: #16120F; }
.kh-grades { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 22px; }
.kh-grades[hidden] { display: none; }
.kh-grade { display: flex; flex-direction: column; gap: 16px; color: #F3EDE2 !important; transition: transform .4s; }
.kh-grade:hover { transform: translateY(-8px); color: #FF7A00 !important; }
.kh-grade figure { margin: 0; aspect-ratio: 1001 / 561; overflow: hidden; background: #2a2522; }
.kh-grade img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.kh-grade:hover img { transform: scale(1.05); }
.kh-grade div { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(243,237,226,.2); padding-top: 14px; font-size: 18px; font-weight: 700; }
.kh-grade div span { font-size: 22px; }
@media (max-width: 767px) { .kh-tabs { width: 100%; } .kh-tabs button { flex: 1; padding: 13px 10px; } }

.kh-courses .kh-headrow, .kh-why .kh-headrow { border-bottom: 0; padding-bottom: 0; }
.kh-why .kh-headrow { margin-bottom: 26px; }

/* الخط الموجي تحت العناوين (.kh-uline) اتنقل لـ css/layout.css */

/* ===== Featured courses (يتعرض من courses.js) ===== */
.kh-courses { padding: 90px 0; }
body.kh-home .kh-courses .row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 26px; margin: 36px 0 0; }
body.kh-home .kh-courses .row > p { grid-column: 1 / -1; color: var(--muted) !important; padding: 30px 0; }
body.kh-home .kh-courses .card-course { width: auto; max-width: none; flex: none; padding: 0; margin: 0; }
body.kh-home .kh-courses .course { height: 100%; display: flex; flex-direction: column; align-items: stretch; padding: 0; border-radius: 0; background: var(--card) !important; border: 1px solid var(--line); transition: transform .4s, box-shadow .4s; }
body.kh-home .kh-courses .course:hover { transform: translateY(-8px); box-shadow: 12px 12px 0 var(--or); }
body.kh-home .kh-courses .course-free::after { display: none; }
body.kh-home .kh-free-section .course:hover { box-shadow: 12px 12px 0 #2ecc71; }
body.kh-home .kh-courses .course img { width: 100%; aspect-ratio: 1001 / 561; object-fit: cover; border-radius: 0; display: block; }
body.kh-home .kh-courses .content-course { padding: 22px 22px 24px; gap: 14px; flex: 1; }
body.kh-home .kh-courses .content-course h4 { margin: 0; padding: 0; font-family: 'KhLama', sans-serif; font-weight: 700; font-size: 19px; line-height: 1.6; text-align: right; color: var(--ink) !important; }
body.kh-home .kh-courses .content-course .number-lect { position: static; width: auto; left: 0; margin: 0; padding: 0; background: none !important; font-family: 'KhLama', sans-serif; font-weight: 400; font-size: 14px; line-height: 1.8; text-align: right; justify-content: flex-start; color: var(--muted) !important; flex-grow: 0; }
body.kh-home .kh-courses .data-course { margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line); gap: 10px; }
body.kh-home .kh-courses .data-course .price { background: none !important; padding: 0; margin: 0; font-family: 'KhLama', sans-serif; font-size: 14px; color: var(--muted) !important; align-items: baseline; }
body.kh-home .kh-courses .data-course .price span { font-family: 'Readex Pro', sans-serif; font-weight: 700; font-size: 30px; color: var(--ink) !important; }
body.kh-home .kh-courses .data-course .price-del { background: none !important; padding: 0; margin: 0; font-size: 13px; color: var(--muted) !important; }
body.kh-home .kh-courses .data-course .price-del span { background: none !important; color: var(--or) !important; padding: 0; }
body.kh-home .kh-courses .price-free, body.kh-home .kh-courses .you-subscription { background: var(--or) !important; color: #16120F !important; border: 0; border-radius: 0; font-size: 13px; font-weight: 700; padding: 7px 12px; font-family: 'KhLama', sans-serif; }
body.kh-home .kh-free-section .price-free { background: #2ecc71 !important; color: #fff !important; }
body.kh-home .kh-courses .info-course p { font-family: 'KhLama', sans-serif; font-size: 11px; color: var(--muted) !important; display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 4px; }
body.kh-home .kh-courses .info-course svg { color: var(--or) !important; }
body.kh-home .kh-courses .course-subscription { margin-top: 4px; }
body.kh-home .kh-courses .course-subscription .check { border: 0; border-radius: 0; background: var(--ink) !important; color: var(--paper) !important; font-family: 'KhLama', sans-serif; font-weight: 700; font-size: 15px; padding: 14px; transition: background .25s; }
body.kh-home .kh-courses .course-subscription .check:hover { background: var(--or) !important; color: #16120F !important; }

/* ===== Reviews ===== */
.kh-reviews { padding: 20px 0 100px; }
.kh-reviews .kh-h2 { margin-bottom: 30px; }
.kh-ticker { overflow: hidden; }
.kh-ticker-track { display: flex; gap: 22px; width: max-content; animation: khTicker 40s linear infinite; }
.kh-ticker:hover .kh-ticker-track { animation-play-state: paused; }
.kh-review { width: 300px; flex: none; background: var(--card); border: 1px solid var(--line); padding: 14px; }
.kh-review:nth-child(odd) { transform: rotate(-1.2deg); }
.kh-review:nth-child(even) { transform: rotate(1deg); }
.kh-review img { width: 100%; height: auto; display: block; }
@media (max-width: 767px) { .kh-review { width: 240px; } }

/* ===== Reveal on scroll ===== */
.kh-js [data-reveal] { opacity: 0; transform: translateY(36px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--d, 0) * .1s); }
.kh-js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { body.kh-home * { animation: none !important; } .kh-js [data-reveal] { opacity: 1; transform: none; } }
