/* ============================================================
   AI LEARN — Design System
   Dark cosmic theme · Claude coral accent · Outfit + JetBrains Mono
   ============================================================ */

:root {
  --bg: #05070c;
  --bg-2: #0a0e17;
  --bg-3: #0e1420;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf4;
  --muted: #aeb8cc;
  --faint: #7b859a;
  --ar-ink: #c6cedf;   /* Arabic body — brighter: Cairo reads lighter than Outfit */

  --accent: #da7756;        /* Claude coral */
  --accent-soft: rgba(218, 119, 86, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.14);
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.12);
  --gold: #fbbf24;
  --gold-soft: rgba(251, 191, 36, 0.12);
  --rose: #fb7185;

  --grad: linear-gradient(120deg, #da7756 0%, #c084fc 50%, #38bdf8 100%);
  --grad-warm: linear-gradient(120deg, #f59e0b, #da7756, #fb7185);

  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --font-ar: 'Cairo', 'Outfit', system-ui, sans-serif;

  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
  --nav-h: 68px;
  --maxw: 1160px;

  --shadow-glow: 0 0 60px rgba(218, 119, 86, 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
html.motion-off { scroll-behavior: auto; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
::selection { background: rgba(218, 119, 86, 0.35); }

/* Subtle cosmic backdrop layers */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(139, 92, 246, 0.10), transparent 60%),
    radial-gradient(900px 480px at 10% 0%, rgba(218, 119, 86, 0.08), transparent 55%),
    radial-gradient(800px 600px at 50% 110%, rgba(56, 189, 248, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#starfield {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

main, nav, footer { position: relative; z-index: 1; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); text-shadow: 0 0 90px rgba(192, 132, 252, 0.25); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
p  { color: var(--muted); }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: center; row-gap: 2px;
  line-height: 1.7;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(218, 119, 86, 0.25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.kicker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(218, 119, 86, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(218, 119, 86, 0); }
}

.lead { font-size: clamp(1.08rem, 1.7vw, 1.3rem); max-width: 46rem; }

/* ---------- Layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
section { padding: 96px 0; }
.section-head { max-width: 46rem; margin-bottom: 48px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-bottom: 14px; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex; align-items: center;
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
}
.nav-inner {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.18rem; letter-spacing: -0.02em;
}
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  color: #0b0d12; font-weight: 900; font-size: 1rem;
  box-shadow: 0 4px 18px rgba(218, 119, 86, 0.35);
}
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a {
  padding: 8px 14px; border-radius: 10px;
  font-size: 0.94rem; font-weight: 500; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-links a.active { position: relative; }
.nav-links a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; border-radius: 2px; background: var(--grad);
}
.nav-cta {
  padding: 9px 18px; border-radius: 12px;
  background: var(--grad); background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  color: #0b0d12; font-weight: 700; font-size: 0.92rem;
  box-shadow: 0 4px 20px rgba(218, 119, 86, 0.3);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(218, 119, 86, 0.45); }

.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-burger span {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--text); transition: transform 0.3s, opacity 0.3s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-burger { display: flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: rgba(5, 7, 12, 0.97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 22px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.3s;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 16px; }
  .nav-cta-wrap { display: none; }
}

/* Scroll progress bar */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--grad); z-index: 101;
  box-shadow: 0 0 12px rgba(218, 119, 86, 0.6);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 92vh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 60px) 0 80px;
  position: relative;
}
.hero-inner { position: relative; z-index: 2; }
.hero h1 { margin: 14px 0 22px; max-width: 15ch; }
.hero .lead { margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.5; pointer-events: none;
}
.orb-1 { width: 420px; height: 420px; background: rgba(218, 119, 86, 0.22); top: 8%; right: -6%; animation: float 11s ease-in-out infinite; }
.orb-2 { width: 340px; height: 340px; background: rgba(139, 92, 246, 0.20); bottom: 0%; left: -8%; animation: float 14s ease-in-out infinite reverse; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-28px, 26px) scale(1.06); }
}

/* Typing caret */
.type-caret::after {
  content: '▍';
  color: var(--accent);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 14px;
  font-weight: 700; font-size: 1rem;
  transition: transform 0.22s var(--ease), box-shadow 0.22s, background 0.22s, border-color 0.22s;
}
.btn-primary {
  background: var(--grad); background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  color: #0b0d12;
  box-shadow: 0 6px 26px rgba(218, 119, 86, 0.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 36px rgba(218, 119, 86, 0.5); }
.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--accent-soft); }
.btn .arrow { transition: transform 0.22s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--grad);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover::before { opacity: 1; }

.card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.45rem;
  margin-bottom: 18px;
  background: var(--accent-soft);
  border: 1px solid rgba(218, 119, 86, 0.25);
}
.card h3 { margin-bottom: 10px; }
.card p { font-size: 1rem; line-height: 1.78; }
.card .card-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; font-weight: 600; font-size: 0.92rem;
  color: var(--accent);
}
.card .card-link .arrow { transition: transform 0.2s; }
.card:hover .card-link .arrow { transform: translateX(4px); }

/* Icon tint variants */
.tint-violet { background: var(--violet-soft); border-color: rgba(167, 139, 250, 0.3); }
.tint-cyan   { background: var(--cyan-soft);   border-color: rgba(56, 189, 248, 0.3); }
.tint-green  { background: var(--green-soft);  border-color: rgba(52, 211, 153, 0.3); }
.tint-gold   { background: var(--gold-soft);   border-color: rgba(251, 191, 36, 0.3); }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.badge.accent { color: var(--accent); border-color: rgba(218, 119, 86, 0.4); background: var(--accent-soft); }
.badge.violet { color: var(--violet); border-color: rgba(167, 139, 250, 0.4); background: var(--violet-soft); }
.badge.cyan   { color: var(--cyan);   border-color: rgba(56, 189, 248, 0.4);  background: var(--cyan-soft); }
.badge.green  { color: var(--green);  border-color: rgba(52, 211, 153, 0.4);  background: var(--green-soft); }
.badge.gold   { color: var(--gold);   border-color: rgba(251, 191, 36, 0.4);  background: var(--gold-soft); }

/* ---------- Code blocks ---------- */
.code-block {
  background: #0a0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 18px 0;
  font-size: 0.88rem;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--faint);
}
.code-dots { display: flex; gap: 6px; }
.code-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.code-dots i:nth-child(1) { background: #ff5f57; }
.code-dots i:nth-child(2) { background: #febc2e; }
.code-dots i:nth-child(3) { background: #28c840; }
.copy-btn {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--faint); padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.code-block pre {
  padding: 18px 20px; overflow-x: auto;
  font-family: var(--font-mono); line-height: 1.7;
  color: #d3dae6;
}
.code-block .c-cm { color: #5b6478; }       /* comment */
.code-block .c-kw { color: #c084fc; }       /* keyword */
.code-block .c-st { color: #7dd3a7; }       /* string */
.code-block .c-fn { color: #38bdf8; }       /* function */
.code-block .c-pr { color: var(--accent); } /* prompt/$ */

code.inline {
  font-family: var(--font-mono); font-size: 0.86em;
  background: linear-gradient(135deg, rgba(218,119,86,0.14), rgba(167,139,250,0.10));
  border: 1px solid rgba(218, 119, 86, 0.28);
  padding: 2px 8px; border-radius: 7px;
  color: #f0b795;
  white-space: nowrap;
}

/* Marker-swipe highlight — Arabic & English strong words glow with a
   gradient underline that sweeps in when the block reveals */
.ar-block strong, strong.hl {
  color: var(--text);
  font-weight: 800;
  background-image: linear-gradient(120deg, rgba(218,119,86,0.55), rgba(192,132,252,0.55));
  background-repeat: no-repeat;
  background-size: 100% 0.32em;
  background-position: 0 92%;
  padding: 0 2px;
  border-radius: 3px;
  transition: background-size 0.6s var(--ease);
}
html.motion-off .ar-block strong, html.motion-off strong.hl { background-size: 100% 0.32em; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 640px; }
thead th {
  text-align: left; padding: 16px 18px;
  font-family: var(--font-mono); font-size: 0.74rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}
tbody td { padding: 15px 18px; border-bottom: 1px solid var(--border); color: var(--ar-ink); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
tbody td:first-child { color: var(--text); font-weight: 600; }

/* ---------- Steps / timeline ---------- */
.steps { display: flex; flex-direction: column; gap: 0; position: relative; }
.step {
  display: grid; grid-template-columns: 56px 1fr; gap: 22px;
  padding: 26px 0; position: relative;
}
.step:not(:last-child)::before {
  content: '';
  position: absolute; left: 27px; top: 76px; bottom: -6px;
  width: 2px;
  background: linear-gradient(to bottom, rgba(218, 119, 86, 0.5), rgba(139, 92, 246, 0.2));
}
.step-num {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  background: var(--accent-soft);
  border: 1px solid rgba(218, 119, 86, 0.35);
  color: var(--accent);
}
.step-body h3 { margin-bottom: 8px; }
.step-body p { font-size: 1.02rem; line-height: 1.8; }

/* ---------- Ladder (effort levels) ---------- */
.ladder { display: flex; flex-direction: column; gap: 14px; }
.rung {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.rung:hover { transform: translateX(8px); border-color: var(--border-strong); }
.rung-label { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; }
.rung-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; position: relative; }
.rung-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: var(--grad);
  transition: width 1.1s var(--ease);
}
.rung.revealed .rung-fill { width: var(--fill, 50%); }
@media (max-width: 640px) {
  .rung { grid-template-columns: 1fr; gap: 10px; }
}

/* ---------- Compare / vs cards ---------- */
.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 800px) { .vs-grid { grid-template-columns: 1fr; } }
.vs-card { border-radius: var(--radius); padding: 26px; border: 1px solid var(--border); background: var(--surface); }
.vs-card.good { border-color: rgba(52, 211, 153, 0.35); }
.vs-card.bad  { border-color: rgba(251, 113, 133, 0.35); }
.vs-card h4 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 1.05rem; }
.vs-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.vs-card li { color: var(--muted); font-size: 0.94rem; padding-left: 26px; position: relative; }
.vs-card.good li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.vs-card.bad  li::before { content: '✕'; position: absolute; left: 0; color: var(--rose); font-weight: 700; }

/* ---------- Accordion / FAQ ---------- */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.acc-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); overflow: hidden;
  transition: border-color 0.25s;
}
.acc-item[open] { border-color: rgba(218, 119, 86, 0.4); }
.acc-item summary {
  list-style: none; cursor: pointer;
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-weight: 600;
}
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after {
  content: '+'; font-size: 1.3rem; color: var(--accent);
  transition: transform 0.3s var(--ease);
}
.acc-item[open] summary::after { transform: rotate(45deg); }
.acc-body { padding: 0 22px 20px; color: var(--muted); font-size: 1rem; line-height: 1.8; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.stat { text-align: center; padding: 30px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.stat-num {
  font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: var(--cyan-soft);
  padding: 18px 22px;
  display: flex; gap: 14px; align-items: flex-start;
  margin: 20px 0;
  font-size: 1rem; color: var(--ar-ink);
}
.callout .ico { font-size: 1.2rem; line-height: 1.4; }
.callout.warn { border-color: rgba(251, 191, 36, 0.35); background: var(--gold-soft); }
.callout.tip  { border-color: rgba(52, 211, 153, 0.35); background: var(--green-soft); }
.callout strong { color: var(--text); }

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  padding: calc(var(--nav-h) + 90px) 0 70px;
  position: relative;
}
.page-hero h1 { margin: 14px 0 18px; }
.page-hero .lead { max-width: 44rem; }

/* ---------- Next-page footer nav ---------- */
.next-nav {
  display: flex; justify-content: space-between; gap: 18px;
  padding: 40px 0 0;
}
.next-link {
  flex: 1; max-width: 420px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
  padding: 22px 26px;
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.next-link:hover { transform: translateY(-4px); border-color: var(--accent); }
.next-link .dir { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); }
.next-link .title { font-weight: 700; margin-top: 6px; font-size: 1.06rem; }
.next-link.right { text-align: right; margin-left: auto; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
  margin-top: 60px;
  background: linear-gradient(to bottom, transparent, rgba(10, 14, 23, 0.8));
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-size: 0.95rem; margin-bottom: 14px; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 24px; border-top: 1px solid var(--border);
  color: var(--faint); font-size: 0.85rem;
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.revealed { opacity: 1; transform: none; }
.reveal-left { transform: translateX(-36px); }
.reveal-right { transform: translateX(36px); }
.reveal-scale { transform: scale(0.92); }
.reveal-left.revealed, .reveal-right.revealed, .reveal-scale.revealed { transform: none; }
[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }
[data-delay="4"] { transition-delay: 0.4s; }
[data-delay="5"] { transition-delay: 0.5s; }

/* ---------- Motion off / reduced motion ---------- */
html.motion-off *, html.motion-off *::before, html.motion-off *::after {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001s !important;
}
html.motion-off .reveal { opacity: 1; transform: none; }
html.motion-off #starfield { display: none; }
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-on) *, html:not(.motion-on) *::before, html:not(.motion-on) *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
  html:not(.motion-on) .reveal { opacity: 1; transform: none; }
}

/* ---------- Bilingual (Arabic ↔ English) ---------- */
/* Arabic inline fragment inside an English line */
.ar {
  font-family: var(--font-ar);
  direction: rtl;
  unicode-bidi: isolate;
}
/* Full Arabic block: RTL paragraph/heading with Cairo + roomier leading */
.ar-block {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
  line-height: 2.05;
  unicode-bidi: isolate;
  letter-spacing: 0;
  font-size: 1.05em;
  font-weight: 500;
  color: var(--ar-ink);
}
p.ar-block { color: var(--ar-ink); }
.ar { letter-spacing: 0; }
.ar-block .en, .ar-block code.inline, .ar-block .mono {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-display);
}
/* Latin token inside Arabic prose: render as a clear visual chip so the
   eye can jump between scripts without losing the line */
.ar-block .en {
  font-weight: 700;
  color: #e2e9f6;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0 6px;
  margin-inline: 2px;
  font-size: 0.93em;
}
.ar-block strong .en { background: none; border: none; padding: 0; color: inherit; }
.ar-block code.inline { font-family: var(--font-mono); }
h1 .ar, h2 .ar, h3 .ar, .ar-block h1, .ar-block h2, .ar-block h3 { line-height: 1.5; }

/* Bilingual heading pair: English line + Arabic line under it */
.bi { display: flex; flex-direction: column; gap: 4px; }
.bi .bi-ar {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
  align-self: flex-end;
  font-weight: 800;
  color: #bfc9db;
  font-size: 0.7em;
  line-height: 1.65;
  margin-top: 2px;
}
.bi .bi-ar::after {
  content: ' ✦';
  color: var(--accent);
  font-size: 0.7em;
  vertical-align: middle;
}
.section-head.center .bi .bi-ar { align-self: center; text-align: center; }

/* Bilingual divider dot between EN · AR fragments */
.bi-dot { color: var(--faint); margin: 0 8px; font-weight: 400; }

/* Cards that lead with Arabic keep icons/badges LTR-positioned */
.card .ar-block { margin-top: 4px; }

/* kicker latin fragment: keep whole, never split mid-phrase */
.kx { direction: ltr; unicode-bidi: isolate; display: inline-block; white-space: nowrap; }
/* English echo line under an Arabic lead: never collide, whatever the inline offset */
.lead.small.muted { margin-top: 8px !important; }

/* ---------- Utility ---------- */
.mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 40px; } .mt-4 { margin-top: 64px; }
.mb-1 { margin-bottom: 12px; } .mb-2 { margin-bottom: 24px; } .mb-3 { margin-bottom: 40px; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
