@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ReadexPro-400-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/ReadexPro-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/ReadexPro-500-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/ReadexPro-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/ReadexPro-600-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/ReadexPro-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/ReadexPro-700-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/ReadexPro-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/Tajawal-400-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/Tajawal-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/Tajawal-500-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/Tajawal-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/Tajawal-700-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/Tajawal-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/Tajawal-800-arabic.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Tajawal'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/Tajawal-800-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

/* ============================================================
   Adam Training Department — Redesign concept (RTL, mobile-first)
   Design tokens + shared components for index.html / topic.html
   ============================================================ */

:root {
  /* Brand */
  --red-900: #6f1414;
  --red-800: #8a1a1a;
  --red-700: #b91c1c;   /* Adam red (current brand) */
  --red-600: #d32626;
  --red-050: #fdf2f0;

  /* Neutrals — warm, pharmacy-clean */
  --ink: #1c1a19;
  --body: #45403d;
  --muted: #857c76;
  --line: #efe6e1;
  --bg: #faf7f4;
  --card: #ffffff;

  /* Shape & depth */
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-pill: 999px;
  --shadow-card: 0 1px 2px rgba(28, 18, 14, .05), 0 12px 32px -12px rgba(28, 18, 14, .12);
  --shadow-lift: 0 2px 4px rgba(28, 18, 14, .06), 0 24px 48px -16px rgba(138, 26, 26, .22);
  --shadow-btn: 0 10px 24px -10px rgba(185, 28, 28, .55);

  /* Motion */
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .18s;
  --dur-med: .45s;
  --dur-slow: .9s;

  --font-body: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Readex Pro", "Tajawal", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.35;
  font-weight: 700;
}

.container { width: min(1180px, 92%); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  padding-block: 14px;
  transition: background var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out),
              padding var(--dur-med) var(--ease-out);
}
.site-header.scrolled {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line), 0 12px 32px -20px rgba(28, 18, 14, .25);
  padding-block: 9px;
}
.site-header.on-dark:not(.scrolled) { color: #fff; }
.site-header.on-dark:not(.scrolled) .wordmark { color: #fff; }
.site-header.on-dark:not(.scrolled) .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); }

.header-inner { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 50%;
  background: #fff; padding: 4px;
  box-shadow: 0 4px 14px -4px rgba(111, 20, 20, .35);
  transition: transform var(--dur-med) var(--ease-spring);
}
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.wordmark {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.02rem; color: var(--red-700);
  letter-spacing: .2px;
}
.wordmark small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.site-header.on-dark:not(.scrolled) .wordmark small { color: rgba(255,255,255,.75); }

.header-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.nav-link {
  font-weight: 500; font-size: .95rem; padding: 8px 14px; border-radius: var(--r-pill);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.nav-link:hover { background: rgba(185, 28, 28, .08); color: var(--red-700); }
.site-header.on-dark:not(.scrolled) .nav-link:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  padding: 13px 30px; border-radius: var(--r-pill);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast), filter var(--dur-fast);
  will-change: transform;
}
.btn:active { transform: scale(.965); }
.btn:focus-visible { outline: 3px solid rgba(185, 28, 28, .35); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--red-600), var(--red-700) 55%, var(--red-800));
  color: #fff; box-shadow: var(--shadow-btn);
  position: relative; overflow: hidden;
}
.btn-primary::after {           /* sheen sweep on hover */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(120%);
  transition: transform .7s var(--ease-out);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 16px 32px -12px rgba(185, 28, 28, .6); }
.btn-primary:hover::after { transform: translateX(-120%); }

.btn-ghost {
  background: transparent; color: var(--red-700);
  border: 1.6px solid rgba(185, 28, 28, .45);
}
.btn-ghost:hover { background: var(--red-050); border-color: var(--red-700); transform: translateY(-2px); }

.btn-light { background: #fff; color: var(--red-700); box-shadow: 0 10px 26px -12px rgba(0,0,0,.35); }
.btn-light:hover { transform: translateY(-2px); }

/* ---------- Reveal-on-scroll ----------
   Fail-open: elements are visible by default. They hide only after motion.js
   has successfully armed its observers (.motion-armed on <html>), so any JS
   or observer failure leaves all content visible. */
.motion-armed [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.motion-armed [data-reveal="start"] { transform: translateX(32px); }
.motion-armed [data-reveal="scale"] { transform: scale(.94); }
.motion-armed [data-reveal].revealed { opacity: 1; transform: none; }

/* Hero entrance: pure CSS, plays on load, always settles visible */
.hero-in {
  animation: heroIn .7s var(--ease-out) both;
  animation-delay: var(--in-delay, 0ms);
}
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Hero (homepage) ---------- */
.hero {
  position: relative;
  min-height: 92svh;
  display: flex; align-items: center;
  isolation: isolate;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -2; transform: scaleX(-1); } /* mirrored: person on the left, Arabic text clear on the right */
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%;
  animation: heroZoom 1.6s var(--ease-out) both;
}
@keyframes heroZoom { from { transform: scale(1.1); } to { transform: scale(1); } }

.hero::before {   /* scrim tuned for RTL: text sits on the right */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to left, rgba(24, 8, 6, .86) 0%, rgba(24, 8, 6, .6) 38%, rgba(24, 8, 6, .18) 68%, rgba(24, 8, 6, .06) 100%),
    linear-gradient(to bottom, rgba(24, 8, 6, .5), transparent 24%),
    linear-gradient(to top, rgba(24, 8, 6, .55), transparent 34%);
}

.hero-content { color: #fff; max-width: 640px; padding-block: 140px 90px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 500;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(8px);
  padding: 7px 16px; border-radius: var(--r-pill);
  margin-bottom: 22px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff6b5e; animation: pulse 2.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,94,.7);} 55% { box-shadow: 0 0 0 7px rgba(255,107,94,0);} }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.3rem);
  font-weight: 700; color: #fff; line-height: 1.3;
  margin-bottom: 18px;
}
.hero-title .accent { color: #ffb3ab; position: relative; white-space: nowrap; }
.hero-title .accent::after {
  content: ""; position: absolute; right: 0; left: 0; bottom: 6px; height: 10px;
  background: rgba(185, 28, 28, .55); border-radius: 4px; z-index: -1;
  transform: scaleX(0); transform-origin: right;
  animation: underline 1s var(--ease-out) .9s forwards;
}
@keyframes underline { to { transform: scaleX(1); } }

.hero-sub { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: rgba(255,255,255,.88); max-width: 52ch; margin-bottom: 34px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

.scroll-hint {
  position: absolute; bottom: 26px; inset-inline-start: 50%; transform: translateX(50%);
  color: rgba(255,255,255,.75); font-size: .8rem;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.scroll-hint .chev { animation: bob 1.8s var(--ease-out) infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity: .8; } 50% { transform: translateY(7px); opacity: .35; } }

/* ---------- Stats strip ---------- */
.stats { background: var(--card); border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { text-align: center; padding: 34px 10px; position: relative; }
.stat + .stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 26%; height: 48%; width: 1px; background: var(--line); }
.stat-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); color: var(--red-700); line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: .92rem; color: var(--muted); margin-top: 4px; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 110px); }
.section-head { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-kicker {
  display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: .85rem;
  color: var(--red-700); background: var(--red-050);
  padding: 6px 16px; border-radius: var(--r-pill); margin-bottom: 14px;
}
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin-bottom: 12px; }
.section-sub { color: var(--muted); font-size: 1.02rem; }

/* ---------- Feature cards ---------- */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature-card {
  background: var(--card); border-radius: var(--r-xl); padding: 34px 28px;
  box-shadow: var(--shadow-card); border: 1px solid var(--line);
  position: relative; overflow: hidden;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.feature-card::before {   /* top accent grows on hover */
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 4px;
  background: linear-gradient(to left, var(--red-600), var(--red-800));
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--dur-med) var(--ease-out);
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lift); }
.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: var(--red-050); color: var(--red-700);
  margin-bottom: 20px;
  transition: background var(--dur-med), color var(--dur-med), transform var(--dur-med) var(--ease-spring);
}
.feature-card:hover .feature-icon { background: var(--red-700); color: #fff; transform: rotate(-6deg) scale(1.06); }
.feature-title { font-size: 1.18rem; margin-bottom: 10px; }
.feature-text { font-size: .96rem; color: var(--body); }

/* ---------- Steps ---------- */
.steps { background: linear-gradient(180deg, var(--bg), #fff 30%, var(--bg)); }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; counter-reset: step; }
.step { text-align: center; padding: 12px 18px; position: relative; }
.step-num {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.35rem;
  color: var(--red-700); background: #fff;
  border: 2px dashed rgba(185, 28, 28, .4);
  transition: transform var(--dur-med) var(--ease-spring), background var(--dur-med), color var(--dur-med), border-color var(--dur-med);
}
.step:hover .step-num { background: var(--red-700); color: #fff; border-color: var(--red-700); transform: scale(1.1); }
.step-title { font-size: 1.1rem; margin-bottom: 8px; }
.step-text { font-size: .93rem; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--red-800), var(--red-700) 45%, var(--red-900));
  border-radius: var(--r-xl);
  padding: clamp(44px, 6vw, 72px) clamp(26px, 5vw, 64px);
  color: #fff; text-align: center;
  box-shadow: var(--shadow-lift);
}
.cta-band::before, .cta-band::after {   /* ambient blobs */
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
}
.cta-band::before { width: 320px; height: 320px; background: #ff7a6e; top: -140px; inset-inline-end: -90px; animation: drift 9s ease-in-out infinite alternate; }
.cta-band::after { width: 260px; height: 260px; background: #7a0f0f; bottom: -120px; inset-inline-start: -70px; animation: drift 11s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(26px, 18px) scale(1.12); } }
.cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3.2vw, 2.2rem); margin-bottom: 12px; position: relative; }
.cta-band p { color: rgba(255,255,255,.85); margin-bottom: 28px; position: relative; }
.cta-band .btn { position: relative; }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 30px; border-top: 1px solid var(--line); margin-top: 70px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.footer-note { font-size: .88rem; color: var(--muted); }
.footer-credit { text-align: center; font-size: .78rem; font-weight: 700; color: var(--red-700); margin-top: 10px; }

/* ============================================================
   Topic page (post-login, Udemy/Coursera-style)
   ============================================================ */
.course-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #2a0d0b 0%, var(--red-900) 42%, var(--red-800) 100%);
  color: #fff; padding: 120px 0 90px;
}
.course-hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 320px at 85% 20%, rgba(255, 122, 110, .22), transparent 70%);
}
.crumbs { font-size: .85rem; color: rgba(255,255,255,.65); margin-bottom: 16px; position: relative; }
.crumbs a:hover { color: #fff; }
.course-title { color: #fff; font-size: clamp(1.55rem, 3.6vw, 2.5rem); margin-bottom: 6px; position: relative; }
.course-title-en { font-family: var(--font-display); color: rgba(255,255,255,.55); font-size: 1rem; font-weight: 500; margin-bottom: 20px; position: relative; direction: ltr; text-align: end; }

.course-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; position: relative; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  padding: 7px 15px; border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
}

.course-progress { max-width: 520px; position: relative; }
.progress-track {
  height: 10px; border-radius: var(--r-pill);
  background: rgba(255,255,255,.18); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  min-width: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(to left, #ffb3ab, #ff6b5e);
  position: relative;
  transition: width 1.4s var(--ease-out);
}
.progress-fill::after {  /* shimmer sweep */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%);
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer { from { transform: translateX(140%);} to { transform: translateX(-140%);} }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; color: rgba(255,255,255,.8); margin-top: 9px; }

.course-body { margin-top: -54px; position: relative; z-index: 2; padding-bottom: 80px; }
.course-grid { display: grid; grid-template-columns: 1fr 360px; gap: 26px; align-items: start; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--shadow-card);
  overflow: hidden;
}
.panel + .panel { margin-top: 22px; }
.panel-head { padding: 22px 26px 0; }
.panel-title { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.panel-title .ticon { width: 34px; height: 34px; border-radius: 10px; background: var(--red-050); color: var(--red-700); display: grid; place-items: center; }
.panel-body { padding: 20px 26px 26px; }

/* Player — neutral surface; the real lesson thumbnail/player is injected by the app */
.player { position: relative; aspect-ratio: 16/9; background: linear-gradient(150deg, #1c0a08, #3a1410 55%, #140807); }
.player-play {
  position: absolute; inset: 0; margin: auto;
  width: 84px; height: 84px; border-radius: 50%;
  background: rgba(185, 28, 28, .92); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 18px 40px -12px rgba(185, 28, 28, .7);
  transition: transform var(--dur-med) var(--ease-spring), background var(--dur-fast);
}
.player-play:hover { transform: scale(1.12); background: var(--red-600); }
.player-play::before {   /* sonar ring */
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  animation: sonar 2.4s var(--ease-out) infinite;
}
@keyframes sonar { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.player-caption { padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.player-caption .now { font-weight: 700; color: var(--ink); font-size: .98rem; }
.player-caption .dur { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* Curriculum (lesson list beside the video) */
.curriculum { position: sticky; top: 96px; }
.lesson-list { list-style: none; }
.lesson {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  transition: background var(--dur-fast);
  cursor: pointer;
}
.lesson:first-child { border-top: 0; }
.lesson:hover { background: var(--red-050); }
.lesson-state {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem;
  border: 2px solid var(--line); color: var(--muted);
  transition: all var(--dur-fast);
}
.lesson.done .lesson-state { background: #14803c; border-color: #14803c; color: #fff; }
.lesson.active { background: var(--red-050); }
.lesson.active .lesson-state { background: var(--red-700); border-color: var(--red-700); color: #fff; }
.lesson-info { flex: 1; min-width: 0; }
.lesson-name { font-weight: 500; color: var(--ink); font-size: .95rem; line-height: 1.5; }
.lesson.active .lesson-name { color: var(--red-700); font-weight: 700; }
.lesson-dur { font-size: .78rem; color: var(--muted); }
.lesson.active .lesson-dur { color: var(--red-600); }

/* Materials (PDFs) */
.material-row {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.material-row + .material-row { margin-top: 12px; }
.material-row:hover { border-color: rgba(185,28,28,.4); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.material-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--red-050); color: var(--red-700); display: grid; place-items: center; }
.material-name { font-weight: 500; color: var(--ink); font-size: .95rem; }
.material-meta { font-size: .78rem; color: var(--muted); }
.material-dl { margin-inline-start: auto; color: var(--red-700); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; transition: background var(--dur-fast); }
.material-dl:hover { background: var(--red-050); }

/* Assessment cards (quiz + AI chat) */
.assess-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.assess-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 24px; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #fff, #fff 60%, var(--red-050));
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med);
}
.assess-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); border-color: rgba(185,28,28,.35); }
.assess-icon { width: 52px; height: 52px; border-radius: 15px; background: var(--red-700); color: #fff; display: grid; place-items: center; margin-bottom: 16px; box-shadow: var(--shadow-btn); }
.assess-card.chat .assess-icon { background: linear-gradient(135deg, #2a0d0b, var(--red-800)); }
.assess-title { font-size: 1.12rem; margin-bottom: 8px; }
.assess-text { font-size: .9rem; color: var(--body); margin-bottom: 16px; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.rule-chip { font-size: .76rem; font-weight: 500; color: var(--red-800); background: rgba(185,28,28,.08); padding: 5px 12px; border-radius: var(--r-pill); }
.assess-card .btn { width: 100%; padding-block: 12px; }

/* Next topic */
.next-topic {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 26px;
}
.next-topic .nt-label { font-size: .8rem; color: var(--muted); }
.next-topic .nt-name { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.next-topic .nt-arrow {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--red-050); color: var(--red-700); display: grid; place-items: center;
  transition: background var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.next-topic:hover .nt-arrow { background: var(--red-700); color: #fff; transform: translateX(-5px); }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .features-grid, .steps-grid { grid-template-columns: 1fr; gap: 16px; }
  .course-grid { display: flex; flex-direction: column; }
  .course-grid > div { display: contents; }   /* mobile order: player, curriculum, materials, assessment, next */
  .course-grid > div > .panel:nth-child(1) { order: 1; }
  .curriculum { position: static; order: 2; margin-top: 22px; }
  .course-grid > div > .panel:nth-child(2) { order: 3; }
  .course-grid > div > .panel:nth-child(3) { order: 4; }
  .course-grid > div > .next-topic { order: 5; }
  .assess-grid { grid-template-columns: 1fr; }
  .hero { min-height: 86svh; }
  .hero::before {
    background:
      linear-gradient(to left, rgba(24, 8, 6, .72), rgba(24, 8, 6, .38) 60%, rgba(24, 8, 6, .22)),
      linear-gradient(to bottom, rgba(24, 8, 6, .5), transparent 30%),
      linear-gradient(to top, rgba(24, 8, 6, .6), transparent 42%);
  }
  .hero-content { padding-block: 120px 70px; }
  .header-nav .nav-link { display: none; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat + .stat::before { display: none; }
  .stat { padding: 20px 10px; }
  .hero-ctas .btn { flex: 1; padding-inline: 18px; }
  /* compact one-row header: brand + a single action, no crowding at 320px */
  .header-inner { gap: 10px; flex-wrap: nowrap; }
  .brand { gap: 8px; min-width: 0; }
  .brand-logo { width: 32px; height: 32px; flex: none; }
  .wordmark { font-size: .78rem; line-height: 1.25; max-width: 150px; } /* wraps to two short lines; the full exact name stays visible */
  .wordmark small { display: none; }
  .header-nav { gap: 6px; flex: none; margin-inline-start: auto; }
  .header-nav .btn { padding: 9px 16px !important; font-size: .85rem; }
  .hide-mobile { display: none !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  [data-reveal], .motion-armed [data-reveal] { opacity: 1; transform: none; }
  .hero-in { animation: none; }
}

/* ============================================================
   Production integration: lesson/topic pages (real app markup)
   ============================================================ */
.lesson-page { padding-top: 74px; }
.lesson-page .site-header .user-chip {
  margin-inline-start: 0;
  background: var(--red-050); color: var(--red-700);
  border: 1px solid rgba(185, 28, 28, .18);
  font-weight: 700;
}
.lesson-page .admin-link { color: var(--red-700); font-weight: 700; font-size: .9rem; }

/* Hero band rendered inside the content flow (not full-bleed) */
.topic-hero { padding: 26px 0 62px; border-radius: var(--r-xl); margin-top: 6px; }
.topic-hero-in { width: min(100%, 1180px); margin-inline: auto; padding-inline: clamp(18px, 4vw, 44px); position: relative; }
.topic-hero .course-title { font-size: clamp(1.35rem, 3vw, 2.05rem); }
.hero-back { margin-bottom: 16px; color: #fff; border-color: rgba(255, 255, 255, .45); background: transparent; }
.hero-back:hover { background: rgba(255, 255, 255, .12); }
.topic-body { margin-top: -36px; padding-bottom: 26px; }
.topic-page .course-grid { width: min(100%, 1180px); margin-inline: auto; padding-inline: clamp(10px, 2vw, 20px); }
.topic-page .course-grid.no-side { grid-template-columns: 1fr; }
.topic-page .player { aspect-ratio: 16 / 9; }
.topic-page .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-ext { text-decoration: none; }
.player-ext:hover { color: var(--red-700); }
.mat-links { margin: 6px 0 10px; padding-inline-start: 56px; }
.topic-page .pdf-frame { width: 100%; height: 480px; border: 1px solid var(--line); border-radius: var(--r-md, 12px); margin-top: 10px; background: #fff; }
.topic-page .quiz-panel h2, .topic-page .chat-panel h2 { margin-top: 0; }
.topic-page .lesson { cursor: pointer; }
.topic-page .lesson:focus-visible { outline: 2px solid var(--red-700); outline-offset: 2px; }
button.panel.next-topic { width: 100%; text-align: start; cursor: pointer; font: inherit; color: inherit; }

/* Topics index cards: align with the card language */
.topic-grid { gap: 16px; }
.topic-card {
  border: 1px solid var(--line); border-radius: var(--r-lg, 16px);
  background: var(--card, #fff); box-shadow: var(--shadow-card, 0 2px 10px rgba(28,18,14,.06));
  padding: 20px; transition: transform var(--dur-med, .25s), box-shadow var(--dur-med, .25s), border-color var(--dur-med, .25s);
}
.topic-card:hover, .topic-card:focus-visible {
  transform: translateY(-4px); border-color: rgba(185, 28, 28, .35);
  box-shadow: var(--shadow-lift, 0 14px 34px -14px rgba(28,18,14,.25));
}

/* Mobile order: player, lessons, materials, assessment, quiz, chat, next.
   Specificity must beat the package's nth-child rules. */
@media (max-width: 940px) {
  .topic-page .course-grid { display: flex; flex-direction: column; }
  .topic-page .course-grid > .course-main { display: contents; }
  .topic-page .course-grid > div > .panel.player-panel { order: 1; }
  .topic-page .course-grid > .panel.curriculum { order: 2; }
  .topic-page .course-grid > div > .panel.materials-panel { order: 3; }
  .topic-page .course-grid > div > .panel.assess-panel { order: 4; }
  .topic-page .course-grid > div > .panel.quiz-panel { order: 5; }
  .topic-page .course-grid > div > .panel.chat-panel { order: 6; }
  .topic-page .course-grid > div > .next-topic { order: 7; }
}

/* Chat input: textarea gets its own full-width row, action buttons below.
   Applies at every width - side-by-side squeezes the textarea on desktop too. */
.chat-input { flex-wrap: wrap; }
.chat-input textarea { flex: 1 1 100%; min-width: 0; }
.chat-input .btn { white-space: normal; min-width: 0; }

/* Grid items and panels must shrink below their min-content on narrow screens */
@media (max-width: 940px) {
  .lesson-layout, .lesson-layout.layout-topics { grid-template-columns: minmax(0, 1fr); }
  .curr-main, .tab-section.topic-page { min-width: 0; }
  .topic-page .course-grid, .topic-page .course-main, .topic-page .panel,
  .topic-page .card, .topic-page .chat-box, .topic-page .topic-quiz, .topic-page .topic-chat { min-width: 0; }
  .topic-page .lead, .topic-page .msg, .topic-page .note, .topic-page .q-title,
  .topic-page .q-opt, .topic-page .points li { overflow-wrap: anywhere; }
  .topic-page .chat-input textarea { min-width: 0; }
}

/* Small phones: keep long bilingual names off the edges (RTL padding fix) */
@media (max-width: 560px) {
  .lesson-page { padding-top: 62px; }
  .topic-page .panel { width: 100%; max-width: 100%; }
  .topic-page .quiz-panel > .panel-body { padding: 14px 6px; }
  .topic-page .quiz-panel .card { padding: 12px 4px; }
  .topic-page .chat-panel > .panel-body { padding: 14px 10px; }
  .topic-hero-in { padding-inline: 18px; }
  .topic-page .course-grid { padding-inline: 2px; }
  .topic-page .panel-body { padding: 16px 18px 20px; }
  .topic-page .panel-head { padding: 18px 18px 0; }
  .topic-page .course-title { word-break: break-word; overflow-wrap: anywhere; }
  .topic-page .lesson-name, .topic-page .material-name { word-break: break-word; overflow-wrap: anywhere; }
  .topic-page .pdf-frame { height: 340px; }
  .topic-page .quiz-head { flex-wrap: wrap; gap: 6px; }
}
